From f19ce6aaf0dfdb599ea037e98d41264e5f91ac66 Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Thu, 21 Sep 2017 15:40:05 +0800 Subject: Fix image os version stored in AAI Change-Id: I669f5dc60243c8414ad00ac45174e2495988da52 issue-id: MULTICLOUD-101 Signed-off-by: Ethan Lynn --- vio/vio/pub/utils/restcall.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vio') 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[''], -- cgit 1.2.3-korg