diff options
author | Yun Huang <yun.huang@windriver.com> | 2018-03-26 15:37:56 +0800 |
---|---|---|
committer | Yun Huang <yun.huang@windriver.com> | 2018-03-26 15:37:56 +0800 |
commit | 1fc775ff7cabcecafd8f373e9474599057422a0a (patch) | |
tree | a27bac752e3092c9b240c3a5da8f947a8d50b548 /windriver/titanium_cloud/registration/views/registration.py | |
parent | e9eb1984964547edd7dee2cdb7a13e66c7b25548 (diff) |
Add HPA cpu instruction set capabilities for TC
Change-Id: I8047bd583b682e1e099efe1c1b55078761004d5f
Issue-ID: MULTICLOUD-200
Signed-off-by: Yun Huang <yun.huang@windriver.com>
Diffstat (limited to 'windriver/titanium_cloud/registration/views/registration.py')
-rw-r--r-- | windriver/titanium_cloud/registration/views/registration.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/windriver/titanium_cloud/registration/views/registration.py b/windriver/titanium_cloud/registration/views/registration.py index c47a75d5..a7103056 100644 --- a/windriver/titanium_cloud/registration/views/registration.py +++ b/windriver/titanium_cloud/registration/views/registration.py @@ -118,6 +118,12 @@ class Registry(newton_registration.Registry): self._logger.debug("storage_capabilities_info: %s" % caps_dict) hpa_caps.append(caps_dict) + # CPU instruction set extension capabilities + caps_dict = self._get_instruction_set_capabilities(flavor) + if len(caps_dict) > 0: + self._logger.debug("instruction_set_capabilities_info: %s" % caps_dict) + hpa_caps.append(caps_dict) + return hpa_caps def _get_hpa_basic_capabilities(self, flavor): @@ -240,3 +246,19 @@ class Registry(newton_registration.Registry): storage_capability['attributes'].append({'hpa-attribute-key': 'ephemeralDiskSize', 'hpa-attribute-value':{'value': str(flavor['OS-FLV-EXT-DATA:ephemeral']), 'unit':'GB'}}) return storage_capability + + def _get_instruction_set_capabilities(self, extra_specs): + instruction_capability = {} + feature_uuid = uuid.uuid4() + + if extra_specs.has_key('hw:capabilities:cpu_info:features'): + instruction_capability['hpaCapabilityID'] = str(feature_uuid) + instruction_capability['hpaFeature'] = 'instructionSetExtensions' + instruction_capability['hardwareArchitecture'] = 'Intel64' + instruction_capability['version'] = 'v1' + + instruction_capability['attributes'] = [] + instruction_capability['attributes'].append({'hpa-attribute-key': 'instructionSetExtensions', + 'hpa-attribute-value':{'value': str(extra_specs['hw:capabilities:cpu_info:features'])}}) + return instruction_capability + |