From: tierno Date: Mon, 5 Sep 2016 10:11:11 +0000 (+0200) Subject: minor changes X-Git-Tag: v1.0.0~47 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=commitdiff_plain;h=4319dadf7254c118456c5c692ae9ca84fc5e60fc minor changes Change-Id: If54fb9866928b5f8b7c40b5ec3dadd311520641a Signed-off-by: tierno --- diff --git a/httpserver.py b/httpserver.py index 9d1f2047..83ed06f4 100644 --- a/httpserver.py +++ b/httpserver.py @@ -746,9 +746,9 @@ def http_post_vnfs(tenant_id): r = utils.remove_extra_items(http_content, used_schema) if r is not None: print "http_post_vnfs: Warning: remove extra items ", r try: - if http_content.get("schema_version") == None: + if used_schema == vnfd_schema_v01: vnf_id = nfvo.new_vnf(mydb,tenant_id,http_content) - elif http_content.get("schema_version") == "0.2": + elif used_schema == vnfd_schema_v02: vnf_id = nfvo.new_vnf_v02(mydb,tenant_id,http_content) else: logger.warning('Unexpected schema_version: %s', http_content.get("schema_version")) @@ -849,11 +849,11 @@ def http_post_scenarios(tenant_id): #if r is not None: print "http_post_scenarios: Warning: remove extra items ", r #print "http_post_scenarios input: ", http_content try: - if http_content.get("schema_version") == None: + if used_schema == nsd_schema_v01: scenario_id = nfvo.new_scenario(mydb, tenant_id, http_content) - elif str(http_content.get("schema_version")) == "2": + elif used_schema == nsd_schema_v02: scenario_id = nfvo.new_scenario_v02(mydb, tenant_id, http_content) - elif http_content.get("schema_version") == "0.3": + elif used_schema == nsd_schema_v03: scenario_id = nfvo.new_scenario_v03(mydb, tenant_id, http_content) else: logger.warning('Unexpected schema_version: %s', http_content.get("schema_version")) diff --git a/nfvo.py b/nfvo.py index ce3a07dd..98c4bbdb 100644 --- a/nfvo.py +++ b/nfvo.py @@ -1629,7 +1629,7 @@ def update(d, u): def create_instance(mydb, tenant_id, instance_dict): #print "Checking that nfvo_tenant_id exists and getting the VIM URI and the VIM tenant_id" - logger.debug("Creating instance...") + #logger.debug("Creating instance...") scenario = instance_dict["scenario"] #find main datacenter @@ -1655,7 +1655,7 @@ def create_instance(mydb, tenant_id, instance_dict): auxNetDict = {} #Auxiliar dictionary. First key:'scenario' or sce_vnf uuid. Second Key: uuid of the net/sce_net. Value: vim_net_id auxNetDict['scenario'] = {} - logger.debug("scenario dict: {}".format(yaml.safe_dump(scenarioDict, indent=4, default_flow_style=False))) #TODO remove + logger.debug("Creating instance from scenario-dict:\n%s", yaml.safe_dump(scenarioDict, indent=4, default_flow_style=False)) #TODO remove instance_name = instance_dict["name"] instance_description = instance_dict.get("description") try: @@ -1734,8 +1734,8 @@ def create_instance(mydb, tenant_id, instance_dict): if interface['vnf_interface'] == vnf_interface['external_name']: vnf_interface['ip_address']=interface['ip_address'] - logger.debug("Merged dictionary") - logger.debug("ScenarioDict:\n{}".format(yaml.safe_dump(scenarioDict,default_flow_style=False, width=256))) + #logger.debug("Merged dictionary") + logger.debug("Creating instance scenario-dict MERGED:\n%s", yaml.safe_dump(scenarioDict, indent=4, default_flow_style=False)) #1. Creating new nets (sce_nets) in the VIM" diff --git a/nfvo_db.py b/nfvo_db.py index a729aa28..19c45e4a 100644 --- a/nfvo_db.py +++ b/nfvo_db.py @@ -32,7 +32,7 @@ import MySQLdb as mdb import json import yaml import time -import sys, os +#import sys, os tables_with_createdat_field=["datacenters","instance_nets","instance_scenarios","instance_vms","instance_vnfs", "interfaces","nets","nfvo_tenants","scenarios","sce_interfaces","sce_nets", diff --git a/test/test_vimconn.sh b/test/test_vimconn.sh index 7b96d867..aedf20ac 100755 --- a/test/test_vimconn.sh +++ b/test/test_vimconn.sh @@ -287,7 +287,7 @@ then #Testing IP parameters in networks printf "%-50s" "Deploying scenario 'complex4' with IP parameters in networks:" - result=`openmano instance-scenario-create --scenario complex4 --name complex4-instance $DIRmano/instance-scenarios/examples/instance-creation-complex4.yaml` + result=`openmano instance-scenario-create $DIRmano/instance-scenarios/examples/instance-creation-complex4.yaml "$key_param1" "$key_param2"` instance=`echo $result |gawk '{print $1}'` ! is_valid_uuid $instance && echo FAIL && echo " $result" && $_exit 1 echo $instance