diff options
author | Huang Haibin <haibin.huang@intel.com> | 2018-03-27 04:58:36 +0800 |
---|---|---|
committer | Huang Haibin <haibin.huang@intel.com> | 2018-03-27 17:16:10 +0800 |
commit | bb20a653c3085e560d1000d8ae88869c2da576fd (patch) | |
tree | d0d257cb6b315b61a09d321c937cce9d2be9c94d | |
parent | ec35e070f380d2188fca9305f1bbe3375ae6cd6f (diff) |
Update ovsdpdk of hpa to AAI flavor
Change-Id: I59eb91e9641e2016e307c8f0ae034edf7c03472c
Issue-ID: MULTICLOUD-195
Signed-off-by: Huang Haibin <haibin.huang@intel.com>
-rw-r--r-- | ocata/ocata/registration/views/registration.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ocata/ocata/registration/views/registration.py b/ocata/ocata/registration/views/registration.py index 3e2d1e43..d824b88e 100644 --- a/ocata/ocata/registration/views/registration.py +++ b/ocata/ocata/registration/views/registration.py @@ -38,6 +38,11 @@ class Registry(newton_registration.Registry): def _discover_flavors(self, vimid="", session=None, viminfo=None): try: cloud_owner, cloud_region_id = extsys.decode_vim_id(vimid) + cloud_extra_info_str = viminfo.get('cloud_extra_info') + if cloud_extra_info_str: + cloud_extra_info = json.loads(cloud_extra_info_str) + cloud_dpdk_info = cloud_extra_info.get("ovsDpdk") + hpa_caps = [] hpa_caps.append("[") for flavor in self._get_list_resources( @@ -73,6 +78,17 @@ class Registry(newton_registration.Registry): extra_arr = extra_specs.split(', ') uuid4 = uuid.uuid4() + # add ovs dpdk + hpa_caps.append("{'hpaCapabilityID': '" + str(uuid4) + "', ") + hpa_caps.append("'hpaFeature': 'ovsDpdk', ") + hpa_caps.append("'hardwareArchitecture': '" + cloud_dpdk_info.get("arch") + "', ") + hpa_caps.append("'version': '" + cloud_dpdk_info.get("version") + "', ") + hpa_caps.append("[") + hpa_caps.append("{'hpa-attribute-key':'"+ cloud_dpdk_info.get("libname") + "', ") + hpa_caps.append("'hpa-attribute-value': {'value':'" + cloud_dpdk_info.get("libvalue") + "'}}, ") + hpa_caps.append("]") + hpa_caps.append("},") + # add basic Capabilities hpa_caps.append("{'hpaCapabilityID': '" + str(uuid4) + "', ") hpa_caps.append("'hpaFeature': 'baseCapabilities', ") |