X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=models%2Fopenmano%2Fpython%2Frift%2Fopenmano%2Frift2openmano.py;h=92296ff40372d2cdd5199d7ca4342c8757964081;hb=refs%2Fchanges%2F35%2F1535%2F1;hp=8a308e61d340c895b0adf23dba30ed3ff156b8b5;hpb=f49375710db1acf3cd74c8651d098b7a08e8d0b2;p=osm%2FSO.git diff --git a/models/openmano/python/rift/openmano/rift2openmano.py b/models/openmano/python/rift/openmano/rift2openmano.py index 8a308e61..92296ff4 100755 --- a/models/openmano/python/rift/openmano/rift2openmano.py +++ b/models/openmano/python/rift/openmano/rift2openmano.py @@ -27,13 +27,13 @@ import yaml import gi gi.require_version('RwYang', '1.0') -gi.require_version('RwVnfdYang', '1.0') -gi.require_version('RwNsdYang', '1.0') +gi.require_version('RwProjectVnfdYang', '1.0') +gi.require_version('RwProjectNsdYang', '1.0') from gi.repository import ( RwYang, - RwVnfdYang, - RwNsdYang, + RwProjectVnfdYang as RwVnfdYang, + RwProjectNsdYang as RwNsdYang, ) import rift.package.store @@ -499,12 +499,11 @@ def rift2openmano_vnfd(rift_vnfd, rift_nsd): if vdu.vm_flavor.has_field("vcpu_count"): vnfc["numas"][0]["cores"] = max(vdu.vm_flavor.vcpu_count, 1) - else: - if vdu.vm_flavor.has_field("vcpu_count") and vdu.vm_flavor.vcpu_count: - vnfc["vcpus"] = vdu.vm_flavor.vcpu_count + if vdu.vm_flavor.has_field("vcpu_count") and vdu.vm_flavor.vcpu_count: + vnfc["vcpus"] = vdu.vm_flavor.vcpu_count - if vdu.vm_flavor.has_field("memory_mb") and vdu.vm_flavor.memory_mb: - vnfc["ram"] = vdu.vm_flavor.memory_mb + if vdu.vm_flavor.has_field("memory_mb") and vdu.vm_flavor.memory_mb: + vnfc["ram"] = vdu.vm_flavor.memory_mb if vdu.has_field("hypervisor_epa"): @@ -542,7 +541,9 @@ def rift2openmano_vnfd(rift_vnfd, rift_nsd): # Add Openmano devices device = {} device["type"] = volume.device_type - device["image"] = volume.image + device["image name"] = volume.image + if volume.has_field("image_checksum"): + device["image checksum"] = volume.image_checksum vnfc["devices"].append(device) vnfc_boot_data_init = False