X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=osm_ro%2Fnfvo_db.py;h=11d7d37050dd908deb108ae6418753606914f25a;hb=d3750b355ef0488accb82ddeb70b9c5941feff6e;hp=3c0e7a55326d4812952c04f5c3e0e8c069ff3ea4;hpb=fc5f80b75e9b9d79a27df62638e03154ca00a767;p=osm%2FRO.git diff --git a/osm_ro/nfvo_db.py b/osm_ro/nfvo_db.py index 3c0e7a55..11d7d370 100644 --- a/osm_ro/nfvo_db.py +++ b/osm_ro/nfvo_db.py @@ -608,7 +608,7 @@ class nfvo_db(db_base.db_base): # vms 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" \ + " vms.availability_zone as availability_zone, vms.osm_id as osm_id" \ " FROM vnfs join vms on vnfs.uuid=vms.vnf_id" \ " WHERE vnfs.uuid='" + vnf['vnf_id'] + "'" \ " ORDER BY vms.created_at" @@ -656,7 +656,7 @@ class nfvo_db(db_base.db_base): iface["ip_address"] = sce_interface["ip_address"] break #nets every net of a vms - cmd = "SELECT uuid,name,type,description FROM nets WHERE vnf_id='{}'".format(vnf['vnf_id']) + cmd = "SELECT uuid,name,type,description, osm_id FROM nets WHERE vnf_id='{}'".format(vnf['vnf_id']) self.logger.debug(cmd) self.cur.execute(cmd) vnf['nets'] = self.cur.fetchall() @@ -672,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,vim_network_name" \ + cmd = "SELECT uuid,name,type,external,description,vim_network_name, osm_id" \ " FROM sce_nets WHERE scenario_id='{}'" \ " ORDER BY created_at ".format(scenario_dict['uuid']) self.logger.debug(cmd) @@ -812,10 +812,10 @@ class nfvo_db(db_base.db_base): if table_name in self.tables_with_created_field: if "created_at" in row: - created_time_param = created_time + row.pop("created_at")*0.00001 + created_time_param = created_time + (index + row.pop("created_at"))*0.00001 else: created_time_param = created_time + index*0.00001 - index += 1 + index += 1 else: created_time_param = 0 self._new_row_internal(table_name, row, add_uuid=False, root_uuid=None,