Fixed the use of vim_network_name at NSD VLD
[osm/RO.git] / osm_ro / nfvo_db.py
index 80697a3..c34a44f 100644 (file)
@@ -582,7 +582,7 @@ class nfvo_db(db_base.db_base):
                     if scenario_dict["cloud_config"]:
                         scenario_dict["cloud-config"] = yaml.load(scenario_dict["cloud_config"])
                     del scenario_dict["cloud_config"]
-                    #sce_vnfs
+                    # sce_vnfs
                     cmd = "SELECT uuid,name,member_vnf_index,vnf_id,description FROM sce_vnfs WHERE scenario_id='{}' "\
                           "ORDER BY created_at".format(scenario_dict['uuid'])
                     self.logger.debug(cmd)
@@ -606,7 +606,7 @@ class nfvo_db(db_base.db_base):
                         self.cur.execute(cmd)
                         vnf['interfaces'] = self.cur.fetchall()
                         # vms
-                        cmd = "SELECT vms.uuid as uuid, flavor_id, image_id, vms.name as name," \
+                        cmd = "SELECT vms.uuid as uuid, flavor_id, image_id, image_list, vms.name as name," \
                               " vms.description as description, vms.boot_data as boot_data, count," \
                               " vms.availability_zone as availability_zone" \
                               " FROM vnfs join vms on vnfs.uuid=vms.vnf_id" \
@@ -620,6 +620,10 @@ class nfvo_db(db_base.db_base):
                                 vm["boot_data"] = yaml.safe_load(vm["boot_data"])
                             else:
                                 del vm["boot_data"]
+                            if vm["image_list"]:
+                                vm["image_list"] = yaml.safe_load(vm["image_list"])
+                            else:
+                                del vm["image_list"]
                             if datacenter_vim_id!=None:
                                 cmd = "SELECT vim_id FROM datacenters_images WHERE image_id='{}' AND datacenter_vim_id='{}'".format(vm['image_id'],datacenter_vim_id)
                                 self.logger.debug(cmd)
@@ -668,7 +672,7 @@ class nfvo_db(db_base.db_base):
                                 raise db_base.db_base_Exception("More than one ip-profile found with this criteria: net_id='{}'".format(vnf_net['uuid']), db_base.HTTP_Bad_Request)
                             
                     #sce_nets
-                    cmd = "SELECT uuid,name,type,external,description" \
+                    cmd = "SELECT uuid,name,type,external,description,vim_network_name" \
                           " FROM sce_nets  WHERE scenario_id='{}'" \
                           " ORDER BY created_at ".format(scenario_dict['uuid'])
                     self.logger.debug(cmd)