+ if args.n:
+ logger.debug("resolving tenant and datacenter names")
+ mano_tenant_id = "None"
+ mano_tenant_name = "None"
+ mano_datacenter_id = "None"
+ mano_datacenter_name = "None"
+ try:
+ mano_tenant_id = _get_item_uuid("tenants", mano_tenant)
+ URLrequest = "http://%s:%s/openmano/tenants/%s" %(mano_host, mano_port, mano_tenant_id)
+ mano_response = requests.get(URLrequest)
+ logger.debug("openmano response: %s", mano_response.text )
+ content = mano_response.json()
+ mano_tenant_name = content["tenant"]["name"]
+ URLrequest = "http://%s:%s/openmano/%s/datacenters/%s" %(mano_host, mano_port, mano_tenant_id, mano_datacenter)
+ mano_response = requests.get(URLrequest)
+ logger.debug("openmano response: %s", mano_response.text )
+ content = mano_response.json()
+ if "error" not in content:
+ mano_datacenter_id = content["datacenter"]["uuid"]
+ mano_datacenter_name = content["datacenter"]["name"]
+ except OpenmanoCLIError:
+ pass
+ print "OPENMANO_TENANT: %s" %mano_tenant
+ print " Id: %s" %mano_tenant_id
+ print " Name: %s" %mano_tenant_name
+ print "OPENMANO_DATACENTER: %s" %str (mano_datacenter)
+ print " Id: %s" %mano_datacenter_id
+ print " Name: %s" %mano_datacenter_name
+ else:
+ print "OPENMANO_TENANT: %s" %mano_tenant
+ print "OPENMANO_DATACENTER: %s" %str (mano_datacenter)