summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2017-09-21 15:40:05 +0800
committerEthan Lynn <ethanlynnl@vmware.com>2017-09-21 15:55:13 +0800
commitf19ce6aaf0dfdb599ea037e98d41264e5f91ac66 (patch)
tree7de0d164c49efad9b26658d4e5477c3de2f7e61d
parent73335f2c7e12d226b8b181bdb420dab5717cad5d (diff)
Fix image os version stored in AAI
Change-Id: I669f5dc60243c8414ad00ac45174e2495988da52 issue-id: MULTICLOUD-101 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-rw-r--r--vio/vio/pub/utils/restcall.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/vio/vio/pub/utils/restcall.py b/vio/vio/pub/utils/restcall.py
index 7434fcc..15dd90b 100644
--- a/vio/vio/pub/utils/restcall.py
+++ b/vio/vio/pub/utils/restcall.py
@@ -249,11 +249,15 @@ class AAIClient(object):
resource = ("/cloud-infrastructure/cloud-regions/cloud-region/"
"%s/%s/images/image/%s" % (
self.cloud_owner, self.cloud_region, image['id']))
+ split_image_name = image['name'].split("-")
+ os_distro = split_image_name[0]
+ os_version = split_image_name[1] if \
+ len(split_image_name) > 1 else ""
body = {
'image-name': image['name'],
# 'image-architecture': image[''],
- 'image-os-distro': image['name'].split("-")[0],
- 'image-os-version': image['name'].split("-")[1],
+ 'image-os-distro': os_distro,
+ 'image-os-version': os_version,
# 'application': image[''],
# 'application-vendor': image[''],
# 'application-version': image[''],