X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=httpserver.py;h=a0216e12f2f209853703f77e240bf54565b57291;hb=06e6c396413630640cafae3488442a0869f1642d;hp=8cd482f939e389889084ba6421a7fd9ac528b626;hpb=551e5329c53acede500628b41beb3d8f2cff69ad;p=osm%2FRO.git diff --git a/httpserver.py b/httpserver.py index 8cd482f9..a0216e12 100644 --- a/httpserver.py +++ b/httpserver.py @@ -483,14 +483,14 @@ def http_get_datacenter_id(tenant_id, datacenter_id): try: config_dict = yaml.load(vim_tenant['config']) vim_tenant['config'] = config_dict - except Exception, e: + except Exception as e: logger.error("Exception '%s' while trying to load config information", str(e)) if datacenter['config'] != None: try: config_dict = yaml.load(datacenter['config']) datacenter['config'] = config_dict - except Exception, e: + except Exception as e: logger.error("Exception '%s' while trying to load config information", str(e)) #change_keys_http2db(content, http2db_datacenter, reverse=True) convert_datetime2str(datacenter) @@ -975,9 +975,9 @@ def http_post_scenarios(tenant_id): if used_schema == nsd_schema_v01: scenario_id = nfvo.new_scenario(mydb, tenant_id, http_content) elif used_schema == nsd_schema_v02: - scenario_id = nfvo.new_scenario_v02(mydb, tenant_id, http_content) + scenario_id = nfvo.new_scenario_v02(mydb, tenant_id, http_content, "0.2") elif used_schema == nsd_schema_v03: - scenario_id = nfvo.new_scenario_v03(mydb, tenant_id, http_content) + scenario_id = nfvo.new_scenario_v02(mydb, tenant_id, http_content, "0.3") else: logger.warning('Unexpected schema_version: %s', http_content.get("schema_version")) bottle.abort(HTTP_Bad_Request, "Invalid schema version") @@ -1086,10 +1086,11 @@ def http_get_scenario_id(tenant_id, scenario_id): @bottle.route(url_base + '//scenarios/', method='DELETE') def http_delete_scenario_id(tenant_id, scenario_id): '''delete a scenario from database, can use both uuid or name''' + logger.debug('FROM %s %s %s', bottle.request.remote_addr, bottle.request.method, bottle.request.url) try: #check valid tenant_id if tenant_id != "any": - nfvo.check_tenant(mydb, tenant_id) + nfvo.check_tenant(mydb, tenant_id) #obtain data data = mydb.delete_scenario(scenario_id, tenant_id) #print json.dumps(data, indent=4)