From 4f97bde173941c7437bf1b5f6326042fd4dd7b79 Mon Sep 17 00:00:00 2001 From: Philip Joseph Date: Fri, 30 Sep 2016 19:24:38 +0530 Subject: [PATCH] Support image name and checksum Signed-off-by: Philip Joseph --- models/openmano/python/rift/openmano/rift2openmano.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/models/openmano/python/rift/openmano/rift2openmano.py b/models/openmano/python/rift/openmano/rift2openmano.py index 6cc13a7e..3edbbb01 100755 --- a/models/openmano/python/rift/openmano/rift2openmano.py +++ b/models/openmano/python/rift/openmano/rift2openmano.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# +# # Copyright 2016 RIFT.IO Inc # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -402,7 +402,6 @@ def rift2openmano_vnfd(rift_vnfd): vnfc = { "name": vdu.name, "description": vdu.name, - "VNFC image": vdu.image if os.path.isabs(vdu.image) else "/var/images/{}".format(vdu.image), "numas": [{ "memory": max(int(vdu.vm_flavor.memory_mb/1024), 1), "interfaces":[], @@ -410,6 +409,13 @@ def rift2openmano_vnfd(rift_vnfd): "bridge-ifaces": [], } + if os.path.isabs(vdu.image): + vnfc["VNFC image"] = vdu.image + else: + vnfc["image name"] = vdu.image + if vdu.has_field("image_checksum"): + vnfc["image checksum"] = vdu.image_checksum + numa_node_policy = vdu.guest_epa.numa_node_policy if numa_node_policy.has_field("node"): numa_node = numa_node_policy.node[0] -- 2.25.1