+ vnfc["processor"]["features"].append(feature.feature)
+
+ if vdu.has_field("volumes"):
+ vnfc["devices"] = []
+ # Sort volumes as device-list is implictly ordered by Openmano
+ newvollist = sorted(vdu.volumes, key=lambda k: k.name)
+ for iter_num, volume in enumerate(newvollist):
+ if iter_num == 0:
+ # Convert the first volume to vnfc.image
+ if os.path.isabs(volume.image):
+ vnfc["VNFC image"] = volume.image
+ else:
+ vnfc["image name"] = volume.image
+ if volume.has_field("image_checksum"):
+ vnfc["image checksum"] = volume.image_checksum
+ else:
+ # Add Openmano devices
+ device = {}
+ device["type"] = volume.device_type
+ 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
+ if vdu.has_field("cloud_init") or vdu.has_field("cloud_init_file"):
+ vnfc['boot-data'] = dict()
+ vnfc_boot_data_init = True
+ vnfc['boot-data']['user-data'] = cloud_init(rift_vnfd.id, vdu)
+
+ if vdu.has_field("supplemental_boot_data"):
+ if vdu.supplemental_boot_data.has_field('boot_data_drive'):
+ if vdu.supplemental_boot_data.boot_data_drive is True:
+ if vnfc_boot_data_init is False:
+ vnfc['boot-data'] = dict()
+ vnfc_boot_data_init = True
+ vnfc['boot-data']['boot-data-drive'] = vdu.supplemental_boot_data.boot_data_drive
+
+ if vdu.supplemental_boot_data.has_field('config_file'):
+ om_cfgfile_list = list()
+ for custom_config_file in vdu.supplemental_boot_data.config_file:
+ cfg_source = config_file_init(rift_vnfd.id, vdu, custom_config_file.source)
+ om_cfgfile_list.append({"dest":custom_config_file.dest, "content": cfg_source})
+ vnfc['boot-data']['config-files'] = om_cfgfile_list
+