diff options
Diffstat (limited to 'newton')
-rw-r--r-- | newton/newton/registration/views/hpa.json | 13 | ||||
-rw-r--r-- | newton/newton/registration/views/registration.py | 15 |
2 files changed, 27 insertions, 1 deletions
diff --git a/newton/newton/registration/views/hpa.json b/newton/newton/registration/views/hpa.json index 2f87d21e..534a861e 100644 --- a/newton/newton/registration/views/hpa.json +++ b/newton/newton/registration/views/hpa.json @@ -131,5 +131,18 @@ "hpa-feature": "ovsDpdk", "hpa-version": "v1" } + }, + "instructionSetExtensions": { + "info": { + "hpa-feature": "instructionSetExtensions", + "hpa-version": "v1", + "architecture": "Intel64" + }, + "hpa-attributes": { + "hw:capabilities:cpu_info:features": { + "key": "instructionSetExtensions", + "unit": null + } + } } } diff --git a/newton/newton/registration/views/registration.py b/newton/newton/registration/views/registration.py index 9ed811b8..3a9c5acd 100644 --- a/newton/newton/registration/views/registration.py +++ b/newton/newton/registration/views/registration.py @@ -238,7 +238,7 @@ class Registry(newton_registration.Registry): cloud_dpdk_info = cloud_extra_info.get('ovsDpdk') capability = hpa_dict['ovsDpdk']['info'] capability['hpa-capability-id'] = str(uuid.uuid4()) - capability['hardwareArchitecture'] = cloud_dpdk_info.get('arch') + capability['architecture'] = cloud_dpdk_info.get('arch') attributes = [ { 'hpa-attribute-key': cloud_dpdk_info.get('libname'), @@ -248,6 +248,19 @@ class Registry(newton_registration.Registry): capability['hpa-features-attributes'] = attributes capabilities.append(capability) + # Instruction Set Extensions + if "hw:capabilities:cpu_info:features" in extra_specs: + capability = hpa_dict['instructionSetExtensions'] + capability['hpa-capability-id'] = str(uuid.uuid4()) + attributes = [ + { + 'hpa-attribute-key': hpa_dict['instructionSetExtensions']['hpa-attributes']['hw:capabilities:cpu_info:features'], + 'hpa-attribute-value': '{{\"value\":[\"{0}\"]}}'.format(extra_specs['hw:capabilities:cpu_info:features']) + } + ] + capability['hpa-features-attributes'] = attributes + capabilities.append(capability) + return capabilities def _get_capability_attributes(self, cloud_info, attributes): |