summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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[''],