Fix VIM onboarding 11/31611/1
authorMichael Pauls <michael.pauls@fokus.fraunhofer.de>
Thu, 23 Mar 2017 10:28:25 +0000 (11:28 +0100)
committerMorgan Richomme <morgan.richomme@orange.com>
Thu, 23 Mar 2017 18:06:50 +0000 (18:06 +0000)
Usage openstack client in order to get project id directly

Change-Id: Id75dcd594430501152c3ba02a969ac1a2aaaadc5
Signed-off-by: Michael Pauls <michael.pauls@fokus.fraunhofer.de>
(cherry picked from commit 84a87e788b47d5a8fa3565195672fdddd35f4cf0)

functest/opnfv_tests/vnf/ims/orchestra_ims.py

index d13fe8f..5c19be0 100644 (file)
@@ -311,10 +311,16 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
         creds = os_utils.get_credentials()
         self.logger.info("PoP creds: %s" % creds)
 
+        project_id = os_utils.get_tenant_id(
+            os_utils.get_keystone_client(),
+            creds.get("project_name"))
+
+        self.logger.debug("project id: %s" % project_id)
+
         vim_json = {
             "name": "vim-instance",
             "authUrl": creds.get("auth_url"),
-            "tenant": os.environ.get("OS_PROJECT_ID"),
+            "tenant": project_id,
             "username": creds.get("username"),
             "password": creds.get("password"),
             "securityGroups": [