From 42fcc3be3eab33e0d934b8774a33629f07d47674 Mon Sep 17 00:00:00 2001 From: tierno Date: Wed, 6 Jul 2016 17:20:40 +0200 Subject: [PATCH] Moved auxiliary_functions.py from utils package to the main package Signed-off-by: tierno --- httpserver.py | 56 ++++++++++++------------ nfvo.py | 30 ++++++------- nfvo_db.py | 30 ++++++------- openmanod.py | 4 +- utils/auxiliary_functions.py => utils.py | 0 5 files changed, 60 insertions(+), 60 deletions(-) rename utils/auxiliary_functions.py => utils.py (100%) diff --git a/httpserver.py b/httpserver.py index 0e60b3d2..2fa4200d 100644 --- a/httpserver.py +++ b/httpserver.py @@ -43,7 +43,7 @@ from openmano_schemas import vnfd_schema_v01, vnfd_schema_v02, \ datacenter_schema, datacenter_edit_schema, datacenter_action_schema, datacenter_associate_schema,\ object_schema, netmap_new_schema, netmap_edit_schema import nfvo -from utils import auxiliary_functions as af +import utils global mydb global url_base @@ -316,7 +316,7 @@ def http_post_tenants(): '''insert a tenant into the catalogue. ''' #parse input data http_content,_ = format_in( tenant_schema ) - r = af.remove_extra_items(http_content, tenant_schema) + r = utils.remove_extra_items(http_content, tenant_schema) if r is not None: print "http_post_tenants: Warning: remove extra items ", r result, data = nfvo.new_tenant(mydb, http_content['tenant']) if result < 0: @@ -330,7 +330,7 @@ def http_edit_tenant_id(tenant_id): '''edit tenant details, can use both uuid or name''' #parse input data http_content,_ = format_in( tenant_edit_schema ) - r = af.remove_extra_items(http_content, tenant_edit_schema) + r = utils.remove_extra_items(http_content, tenant_edit_schema) if r is not None: print "http_edit_tenant_id: Warning: remove extra items ", r #obtain data, check that only one exist @@ -402,7 +402,7 @@ def http_get_datacenter_id(tenant_id, datacenter_id): bottle.abort(HTTP_Not_Found, 'Tenant %s not found' % tenant_id) return #obtain data - what = 'uuid' if af.check_valid_uuid(datacenter_id) else 'name' + what = 'uuid' if utils.check_valid_uuid(datacenter_id) else 'name' where_={} where_[what] = datacenter_id select_=['uuid', 'name','vim_url', 'vim_url_admin', 'type', 'config', 'description', 'd.created_at as created_at'] @@ -455,7 +455,7 @@ def http_post_datacenters(): '''insert a tenant into the catalogue. ''' #parse input data http_content,_ = format_in( datacenter_schema ) - r = af.remove_extra_items(http_content, datacenter_schema) + r = utils.remove_extra_items(http_content, datacenter_schema) if r is not None: print "http_post_tenants: Warning: remove extra items ", r result, data = nfvo.new_datacenter(mydb, http_content['datacenter']) if result < 0: @@ -469,7 +469,7 @@ def http_edit_datacenter_id(datacenter_id_name): '''edit datacenter details, can use both uuid or name''' #parse input data http_content,_ = format_in( datacenter_edit_schema ) - r = af.remove_extra_items(http_content, datacenter_edit_schema) + r = utils.remove_extra_items(http_content, datacenter_edit_schema) if r is not None: print "http_edit_datacenter_id: Warning: remove extra items ", r @@ -492,7 +492,7 @@ def http_getnetmap_datacenter_id(tenant_id, datacenter_id, netmap_id=None): bottle.abort(-result, datacenter_dict) where_= {"datacenter_id":datacenter_dict['uuid']} if netmap_id: - if af.check_valid_uuid(netmap_id): + if utils.check_valid_uuid(netmap_id): where_["uuid"] = netmap_id else: where_["name"] = netmap_id @@ -504,7 +504,7 @@ def http_getnetmap_datacenter_id(tenant_id, datacenter_id, netmap_id=None): bottle.abort(-result, content) convert_datetime2str(content) - af.convert_str2boolean(content, ('shared', 'multipoint') ) + utils.convert_str2boolean(content, ('shared', 'multipoint') ) if netmap_id and len(content)==1: data={'netmap' : content[0]} elif netmap_id and len(content)==0: @@ -525,7 +525,7 @@ def http_delnetmap_datacenter_id(tenant_id, datacenter_id, netmap_id=None): bottle.abort(-result, datacenter_dict) where_= {"datacenter_id":datacenter_dict['uuid']} if netmap_id: - if af.check_valid_uuid(netmap_id): + if utils.check_valid_uuid(netmap_id): where_["uuid"] = netmap_id else: where_["name"] = netmap_id @@ -549,7 +549,7 @@ def http_uploadnetmap_datacenter_id(tenant_id, datacenter_id): print "http_postnetmap_datacenter_id error %d %s" % (result, content) bottle.abort(-result, content) convert_datetime2str(content) - af.convert_str2boolean(content, ('shared', 'multipoint') ) + utils.convert_str2boolean(content, ('shared', 'multipoint') ) print content data={'netmaps' : content} return format_out(data) @@ -559,7 +559,7 @@ def http_postnetmap_datacenter_id(tenant_id, datacenter_id): '''creates a new netmap''' #parse input data http_content,_ = format_in( netmap_new_schema ) - r = af.remove_extra_items(http_content, netmap_new_schema) + r = utils.remove_extra_items(http_content, netmap_new_schema) if r is not None: print "http_action_datacenter_id: Warning: remove extra items ", r #obtain data, check that only one exist @@ -568,7 +568,7 @@ def http_postnetmap_datacenter_id(tenant_id, datacenter_id): print "http_postnetmap_datacenter_id error %d %s" % (result, content) bottle.abort(-result, content) convert_datetime2str(content) - af.convert_str2boolean(content, ('shared', 'multipoint') ) + utils.convert_str2boolean(content, ('shared', 'multipoint') ) print content data={'netmaps' : content} return format_out(data) @@ -578,7 +578,7 @@ def http_putnettmap_datacenter_id(tenant_id, datacenter_id, netmap_id): '''edit a netmap''' #parse input data http_content,_ = format_in( netmap_edit_schema ) - r = af.remove_extra_items(http_content, netmap_edit_schema) + r = utils.remove_extra_items(http_content, netmap_edit_schema) if r is not None: print "http_putnettmap_datacenter_id: Warning: remove extra items ", r #obtain data, check that only one exist @@ -595,7 +595,7 @@ def http_action_datacenter_id(tenant_id, datacenter_id): '''perform an action over datacenter, can use both uuid or name''' #parse input data http_content,_ = format_in( datacenter_action_schema ) - r = af.remove_extra_items(http_content, datacenter_action_schema) + r = utils.remove_extra_items(http_content, datacenter_action_schema) if r is not None: print "http_action_datacenter_id: Warning: remove extra items ", r #obtain data, check that only one exist @@ -626,7 +626,7 @@ def http_associate_datacenters(tenant_id, datacenter_id): '''associate an existing datacenter to a this tenant. ''' #parse input data http_content,_ = format_in( datacenter_associate_schema ) - r = af.remove_extra_items(http_content, datacenter_associate_schema) + r = utils.remove_extra_items(http_content, datacenter_associate_schema) if r != None: print "http_associate_datacenters: Warning: remove extra items ", r result, data = nfvo.associate_datacenter_to_tenant(mydb, tenant_id, datacenter_id, http_content['datacenter'].get('vim_tenant'), @@ -701,7 +701,7 @@ def http_get_vnfs(tenant_id): bottle.abort(-result, content) else: #change_keys_http2db(content, http2db_vnf, reverse=True) - af.convert_str2boolean(content, ('public',)) + utils.convert_str2boolean(content, ('public',)) convert_datetime2str(content) data={'vnfs' : content} return format_out(data) @@ -714,7 +714,7 @@ def http_get_vnf_id(tenant_id,vnf_id): print "http_post_vnfs error %d %s" % (-result, data) bottle.abort(-result, data) - af.convert_str2boolean(data, ('public',)) + utils.convert_str2boolean(data, ('public',)) convert_datetime2str(data) return format_out(data) @@ -724,7 +724,7 @@ def http_post_vnfs(tenant_id): print "Parsing the YAML file of the VNF" #parse input data http_content, used_schema = format_in( vnfd_schema_v01, ("version",), {"v0.2": vnfd_schema_v02}) - r = af.remove_extra_items(http_content, used_schema) + r = utils.remove_extra_items(http_content, used_schema) if r is not None: print "http_post_vnfs: Warning: remove extra items ", r result, data = nfvo.new_vnf(mydb,tenant_id,http_content) if result < 0: @@ -783,8 +783,8 @@ def http_post_deploy(tenant_id): '''post topology deploy.''' print "http_post_deploy by tenant " + tenant_id - http_content, used_schema = format_in( nsd_schema_v01, ("schema_version",), {2: nsd_schema_v02}) - #r = af.remove_extra_items(http_content, used_schema) + http_content, used_schema = format_in( nsd_schema_v01, ("version",), {"v0.2": nsd_schema_v02}) + #r = utils.remove_extra_items(http_content, used_schema) #if r is not None: print "http_post_deploy: Warning: remove extra items ", r print "http_post_deploy input: ", http_content @@ -816,8 +816,8 @@ def http_post_verify(tenant_id): def http_post_scenarios(tenant_id): '''add a scenario into the catalogue. Creates the scenario and its internal structure in the OPENMANO DB''' print "http_post_scenarios by tenant " + tenant_id - http_content, used_schema = format_in( nsd_schema_v01, ("schema_version",), {2: nsd_schema_v02}) - #r = af.remove_extra_items(http_content, used_schema) + http_content, used_schema = format_in( nsd_schema_v01, ("schema_version",), {"0.2": nsd_schema_v02}) + #r = utils.remove_extra_items(http_content, used_schema) #if r is not None: print "http_post_scenarios: Warning: remove extra items ", r print "http_post_scenarios input: ", http_content if http_content.get("schema_version") == None: @@ -842,7 +842,7 @@ def http_post_scenario_action(tenant_id, scenario_id): return #parse input data http_content,_ = format_in( scenario_action_schema ) - r = af.remove_extra_items(http_content, scenario_action_schema) + r = utils.remove_extra_items(http_content, scenario_action_schema) if r is not None: print "http_post_scenario_action: Warning: remove extra items ", r if "start" in http_content: result, data = nfvo.start_scenario(mydb, tenant_id, scenario_id, http_content['start']['instance_name'], \ @@ -907,7 +907,7 @@ def http_get_scenarios(tenant_id): bottle.abort(-result, data) else: convert_datetime2str(data) - af.convert_str2boolean(data, ('public',) ) + utils.convert_str2boolean(data, ('public',) ) scenarios={'scenarios':data} #print json.dumps(scenarios, indent=4) return format_out(scenarios) @@ -954,7 +954,7 @@ def http_put_scenario_id(tenant_id, scenario_id): '''edit an existing scenario id''' print "http_put_scenarios by tenant " + tenant_id http_content,_ = format_in( scenario_edit_schema ) - #r = af.remove_extra_items(http_content, scenario_edit_schema) + #r = utils.remove_extra_items(http_content, scenario_edit_schema) #if r is not None: print "http_put_scenario_id: Warning: remove extra items ", r print "http_put_scenario_id input: ", http_content @@ -977,7 +977,7 @@ def http_post_instances(tenant_id): return #parse input data http_content,used_schema = format_in( instance_scenario_create_schema) - r = af.remove_extra_items(http_content, used_schema) + r = utils.remove_extra_items(http_content, used_schema) if r is not None: print "http_post_instances: Warning: remove extra items ", r result, data = nfvo.create_instance(mydb, tenant_id, http_content["instance"]) if result < 0: @@ -1008,7 +1008,7 @@ def http_get_instances(tenant_id): bottle.abort(-result, data) else: convert_datetime2str(data) - af.convert_str2boolean(data, ('public',) ) + utils.convert_str2boolean(data, ('public',) ) instances={'instances':data} print json.dumps(instances, indent=4) return format_out(instances) @@ -1073,7 +1073,7 @@ def http_post_instance_scenario_action(tenant_id, instance_id): return #parse input data http_content,_ = format_in( instance_scenario_action_schema ) - r = af.remove_extra_items(http_content, instance_scenario_action_schema) + r = utils.remove_extra_items(http_content, instance_scenario_action_schema) if r is not None: print "http_post_instance_scenario_action: Warning: remove extra items ", r print "http_post_instance_scenario_action input: ", http_content #obtain data diff --git a/nfvo.py b/nfvo.py index 1a97fa2d..c7932262 100644 --- a/nfvo.py +++ b/nfvo.py @@ -30,7 +30,7 @@ __date__ ="$16-sep-2014 22:05:01$" import imp #import json import yaml -from utils import auxiliary_functions as af +import utils from nfvo_db import HTTP_Unauthorized, HTTP_Bad_Request, HTTP_Internal_Server_Error, HTTP_Not_Found,\ HTTP_Conflict, HTTP_Method_Not_Allowed import console_proxy_thread as cli @@ -1201,7 +1201,7 @@ def start_scenario(mydb, tenant_id, scenario_id, instance_scenario_name, instanc datacenter_id = None datacenter_name=None if datacenter != None: - if af.check_valid_uuid(datacenter): + if utils.check_valid_uuid(datacenter): datacenter_id = datacenter else: datacenter_name = datacenter @@ -1446,7 +1446,7 @@ def create_instance(mydb, tenant_id, instance_dict): datacenter_name=None datacenter = instance_dict.get("datacenter") if datacenter: - if af.check_valid_uuid(datacenter): + if utils.check_valid_uuid(datacenter): datacenter_id = datacenter else: datacenter_name = datacenter @@ -1517,7 +1517,7 @@ def create_instance(mydb, tenant_id, instance_dict): lookfor_network = False if "netmap-use" in descriptor_net: lookfor_network = True - if af.check_valid_uuid(descriptor_net["netmap-use"]): + if utils.check_valid_uuid(descriptor_net["netmap-use"]): filter_text = "scenario id '%s'" % descriptor_net["netmap-use"] lookfor_filter["id"] = descriptor_net["netmap-use"] else: @@ -2051,7 +2051,7 @@ def delete_datacenter(mydb, datacenter): def associate_datacenter_to_tenant(mydb, nfvo_tenant, datacenter, vim_tenant_id=None, vim_tenant_name=None, vim_username=None, vim_password=None): #get datacenter info - if af.check_valid_uuid(datacenter): + if utils.check_valid_uuid(datacenter): result, vims = get_vim(mydb, datacenter_id=datacenter) else: result, vims = get_vim(mydb, datacenter_name=datacenter) @@ -2132,7 +2132,7 @@ def associate_datacenter_to_tenant(mydb, nfvo_tenant, datacenter, vim_tenant_id= def deassociate_datacenter_to_tenant(mydb, tenant_id, datacenter, vim_tenant_id=None): #get datacenter info - if af.check_valid_uuid(datacenter): + if utils.check_valid_uuid(datacenter): result, vims = get_vim(mydb, datacenter_id=datacenter) else: result, vims = get_vim(mydb, datacenter_name=datacenter) @@ -2192,7 +2192,7 @@ def deassociate_datacenter_to_tenant(mydb, tenant_id, datacenter, vim_tenant_id= def datacenter_action(mydb, tenant_id, datacenter, action_dict): #DEPRECATED #get datacenter info - if af.check_valid_uuid(datacenter): + if utils.check_valid_uuid(datacenter): result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_id=datacenter) else: result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_name=datacenter) @@ -2232,13 +2232,13 @@ def datacenter_action(mydb, tenant_id, datacenter, action_dict): return 200, result elif 'net-edit' in action_dict: net = action_dict['net-edit'].pop('net') - what = 'vim_net_id' if af.check_valid_uuid(net) else 'name' + what = 'vim_net_id' if utils.check_valid_uuid(net) else 'name' result, content = mydb.update_rows('datacenter_nets', action_dict['net-edit'], WHERE={'datacenter_id':datacenter_id, what: net}) return result, content elif 'net-delete' in action_dict: net = action_dict['net-deelte'].get('net') - what = 'vim_net_id' if af.check_valid_uuid(net) else 'name' + what = 'vim_net_id' if utils.check_valid_uuid(net) else 'name' result, content = mydb.delete_row_by_dict(FROM='datacenter_nets', WHERE={'datacenter_id':datacenter_id, what: net}) return result, content @@ -2248,7 +2248,7 @@ def datacenter_action(mydb, tenant_id, datacenter, action_dict): def datacenter_edit_netmap(mydb, tenant_id, datacenter, netmap, action_dict): #get datacenter info - if af.check_valid_uuid(datacenter): + if utils.check_valid_uuid(datacenter): result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_id=datacenter) else: result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_name=datacenter) @@ -2262,14 +2262,14 @@ def datacenter_edit_netmap(mydb, tenant_id, datacenter, netmap, action_dict): return -HTTP_Conflict, "More than one datacenters found, try to identify with uuid" datacenter_id=vims.keys()[0] - what = 'uuid' if af.check_valid_uuid(netmap) else 'name' + what = 'uuid' if utils.check_valid_uuid(netmap) else 'name' result, content = mydb.update_rows('datacenter_nets', action_dict['netmap'], WHERE={'datacenter_id':datacenter_id, what: netmap}) return result, content def datacenter_new_netmap(mydb, tenant_id, datacenter, action_dict=None): #get datacenter info - if af.check_valid_uuid(datacenter): + if utils.check_valid_uuid(datacenter): result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_id=datacenter) else: result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_name=datacenter) @@ -2327,7 +2327,7 @@ def datacenter_new_netmap(mydb, tenant_id, datacenter, action_dict=None): def vim_action_get(mydb, tenant_id, datacenter, item, name): #get datacenter info - if af.check_valid_uuid(datacenter): + if utils.check_valid_uuid(datacenter): result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_id=datacenter) else: result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_name=datacenter) @@ -2343,7 +2343,7 @@ def vim_action_get(mydb, tenant_id, datacenter, item, name): myvim=vims[datacenter_id] filter_dict={} if name: - if af.check_valid_uuid(name): + if utils.check_valid_uuid(name): filter_dict["id"] = name else: filter_dict["name"] = name @@ -2415,7 +2415,7 @@ def vim_action_create(mydb, tenant_id, datacenter, item, descriptor): if tenant_id == "any": tenant_id=None - if af.check_valid_uuid(datacenter): + if utils.check_valid_uuid(datacenter): result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_id=datacenter) else: result, vims = get_vim(mydb, nfvo_tenant=tenant_id, datacenter_name=datacenter) diff --git a/nfvo_db.py b/nfvo_db.py index 1bf3e4bc..28317ec3 100644 --- a/nfvo_db.py +++ b/nfvo_db.py @@ -29,7 +29,7 @@ __date__ ="$28-aug-2014 10:05:01$" import MySQLdb as mdb import uuid as myUuid -from utils import auxiliary_functions as af +import utils import json import yaml import time @@ -515,7 +515,7 @@ class nfvo_db(): if error_item_text==None: error_item_text = table - what = 'uuid' if af.check_valid_uuid(uuid_name) else 'name' + what = 'uuid' if utils.check_valid_uuid(uuid_name) else 'name' cmd = " SELECT * FROM %s WHERE %s='%s'" % (table, what, uuid_name) if WHERE_OR: where_or = " OR ".join(map(self.__tuple2db_format_where, WHERE_OR.iteritems() )) @@ -604,7 +604,7 @@ class nfvo_db(): dataifacesDict[vm['name']] = {} for numa in vm.get('numas', []): for dataiface in numa.get('interfaces',[]): - af.convert_bandwidth(dataiface) + utils.convert_bandwidth(dataiface) dataifacesDict[vm['name']][dataiface['name']] = {} dataifacesDict[vm['name']][dataiface['name']]['vpci'] = dataiface['vpci'] dataifacesDict[vm['name']][dataiface['name']]['bw'] = dataiface['bandwidth'] @@ -616,7 +616,7 @@ class nfvo_db(): if 'bridge-ifaces' in vm: bridgeInterfacesDict[vm['name']] = {} for bridgeiface in vm['bridge-ifaces']: - af.convert_bandwidth(bridgeiface) + utils.convert_bandwidth(bridgeiface) bridgeInterfacesDict[vm['name']][bridgeiface['name']] = {} bridgeInterfacesDict[vm['name']][bridgeiface['name']]['vpci'] = bridgeiface.get('vpci',None) bridgeInterfacesDict[vm['name']][bridgeiface['name']]['mac'] = bridgeiface.get('mac_address',None) @@ -862,7 +862,7 @@ class nfvo_db(): # #scenario table # where_list=[] # if tenant_id is not None: where_list.append( "tenant_id='" + tenant_id +"'" ) -# if af.check_valid_uuid(instance_scenario_id): +# if utils.check_valid_uuid(instance_scenario_id): # where_list.append( "uuid='" + instance_scenario_id +"'" ) # else: # where_list.append( "name='" + instance_scenario_id +"'" ) @@ -893,8 +893,8 @@ class nfvo_db(): # self.cur.execute("SELECT uuid, vim_interface_id, instance_vm_id, instance_net_id FROM instance_interfaces WHERE instance_scenario_id='"+ instance_scenario_dict['uuid'] + "'") # instance_scenario_dict['instance_interfaces'] = self.cur.fetchall() # -# af.convert_datetime2str(instance_scenario_dict) -# af.convert_str2boolean(instance_scenario_dict, ('public','shared','external') ) +# utils.convert_datetime2str(instance_scenario_dict) +# utils.convert_str2boolean(instance_scenario_dict, ('public','shared','external') ) # print "2******************************************************************" # return 1, instance_scenario_dict # except (mdb.Error, AttributeError), e: @@ -912,7 +912,7 @@ class nfvo_db(): with self.con: self.cur = self.con.cursor(mdb.cursors.DictCursor) #scenario table - if af.check_valid_uuid(scenario_id): + if utils.check_valid_uuid(scenario_id): where_text = "uuid='%s'" % scenario_id else: where_text = "name='%s'" % scenario_id @@ -986,8 +986,8 @@ class nfvo_db(): else: net['vim_id']=d_net['vim_net_id'] - af.convert_datetime2str(scenario_dict) - af.convert_str2boolean(scenario_dict, ('public','shared','external') ) + utils.convert_datetime2str(scenario_dict) + utils.convert_str2boolean(scenario_dict, ('public','shared','external') ) return 1, scenario_dict except (mdb.Error, AttributeError), e: print "nfvo_db.get_scenario DB Exception %d: %s" % (e.args[0], e.args[1]) @@ -1025,7 +1025,7 @@ class nfvo_db(): self.cur = self.con.cursor(mdb.cursors.DictCursor) #scenario table - if af.check_valid_uuid(scenario_id): + if utils.check_valid_uuid(scenario_id): where_text = "uuid='%s'" % scenario_id else: where_text = "name='%s'" % scenario_id @@ -1168,7 +1168,7 @@ class nfvo_db(): #instance table where_list=[] if tenant_id is not None: where_list.append( "inst.tenant_id='" + tenant_id +"'" ) - if af.check_valid_uuid(instance_id): + if utils.check_valid_uuid(instance_id): where_list.append( "inst.uuid='" + instance_id +"'" ) else: where_list.append( "inst.name='" + instance_id +"'" ) @@ -1229,8 +1229,8 @@ class nfvo_db(): self.cur.execute(cmd) instance_dict['nets'] = self.cur.fetchall() - af.convert_datetime2str(instance_dict) - af.convert_str2boolean(instance_dict, ('public','shared','external') ) + utils.convert_datetime2str(instance_dict) + utils.convert_str2boolean(instance_dict, ('public','shared','external') ) return 1, instance_dict except (mdb.Error, AttributeError), e: print "nfvo_db.get_instance_scenario DB Exception %d: %s" % (e.args[0], e.args[1]) @@ -1250,7 +1250,7 @@ class nfvo_db(): #instance table where_list=[] if tenant_id is not None: where_list.append( "tenant_id='" + tenant_id +"'" ) - if af.check_valid_uuid(instance_id): + if utils.check_valid_uuid(instance_id): where_list.append( "uuid='" + instance_id +"'" ) else: where_list.append( "name='" + instance_id +"'" ) diff --git a/openmanod.py b/openmanod.py index 522a6576..0df8202d 100755 --- a/openmanod.py +++ b/openmanod.py @@ -45,7 +45,7 @@ import getopt import yaml import nfvo_db from jsonschema import validate as js_v, exceptions as js_e -from utils import auxiliary_functions as af +import utils from openmano_schemas import config_schema import nfvo @@ -59,7 +59,7 @@ def load_configuration(configuration_file): return (False, "Error: Configuration file '"+configuration_file+"' does not exists.") #Read file - (return_status, code) = af.read_file(configuration_file) + (return_status, code) = utils.read_file(configuration_file) if not return_status: return (return_status, "Error loading configuration file '"+configuration_file+"': "+code) #Parse configuration file diff --git a/utils/auxiliary_functions.py b/utils.py similarity index 100% rename from utils/auxiliary_functions.py rename to utils.py -- 2.25.1