From 119cfc10d4c3210677aea01730f17cf2ba4a0e91 Mon Sep 17 00:00:00 2001 From: Nate Potter Date: Tue, 27 Mar 2018 07:39:30 -0700 Subject: Add Instruction Set Extensions to HPA fetching Change-Id: I5bffde146d9c6e5187069e3172c8748ab944bf04 Signed-off-by: Nathaniel Potter Issue-ID: MULTICLOUD-179 --- newton/newton/registration/views/hpa.json | 13 +++++++++++++ newton/newton/registration/views/registration.py | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) 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): -- cgit 1.2.3-korg