From bb20a653c3085e560d1000d8ae88869c2da576fd Mon Sep 17 00:00:00 2001 From: Huang Haibin Date: Tue, 27 Mar 2018 04:58:36 +0800 Subject: Update ovsdpdk of hpa to AAI flavor Change-Id: I59eb91e9641e2016e307c8f0ae034edf7c03472c Issue-ID: MULTICLOUD-195 Signed-off-by: Huang Haibin --- ocata/ocata/registration/views/registration.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ocata') 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', ") -- cgit 1.2.3-korg