summaryrefslogtreecommitdiffstats
path: root/newton
diff options
context:
space:
mode:
authorNate Potter <nathaniel.potteR@intel.com>2018-03-27 07:39:30 -0700
committerNate Potter <nathaniel.potteR@intel.com>2018-03-28 02:29:22 -0700
commit119cfc10d4c3210677aea01730f17cf2ba4a0e91 (patch)
tree6cb7735cf1738708a80031cde059c984a5e5ba40 /newton
parentb5bfb3bfb3bbb0c668ced0ddda7d63579ecf73b8 (diff)
Add Instruction Set Extensions to HPA fetching
Change-Id: I5bffde146d9c6e5187069e3172c8748ab944bf04 Signed-off-by: Nathaniel Potter <nathaniel.potter@intel.com> Issue-ID: MULTICLOUD-179
Diffstat (limited to 'newton')
-rw-r--r--newton/newton/registration/views/hpa.json13
-rw-r--r--newton/newton/registration/views/registration.py15
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):