summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhang ab <zhanganbing@chinamobile.com>2018-03-27 01:57:59 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-27 01:57:59 +0000
commiteed055356d82a16530dcd1cf3960fbfbe4d774e0 (patch)
tree716fe5a61f8413fa54b3caf94bd9eb1cdfebcd9a
parent98d4de0e97d056a29dc21e1a5018e1e8f78831f8 (diff)
parentbb20a653c3085e560d1000d8ae88869c2da576fd (diff)
Merge "Update ovsdpdk of hpa to AAI flavor"
-rw-r--r--ocata/ocata/registration/views/registration.py16
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', ")