summaryrefslogtreecommitdiffstats
path: root/tests/identity_auth.py
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2017-05-10 15:21:38 +0800
committerwenjuan dong <dong.wenjuan@zte.com.cn>2017-07-07 06:18:42 +0000
commit183dee7dc0d1c5086ad5d919b7eba955d1d011e9 (patch)
tree79a1031e47f68a55df6a4e6934f442f9a706b309 /tests/identity_auth.py
parent2e35513b691b0319b96182c5d9c39e4ab1a97552 (diff)
Add create instances
JIRA: DOCTOR-93 Change-Id: I7645c1cc0c76ff86b9fbcc01c19038469fc9b9b4 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'tests/identity_auth.py')
-rw-r--r--tests/identity_auth.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/identity_auth.py b/tests/identity_auth.py
index ffecc68a..c94893f4 100644
--- a/tests/identity_auth.py
+++ b/tests/identity_auth.py
@@ -13,13 +13,14 @@ from keystoneauth1 import loading
from keystoneauth1 import session
-def get_identity_auth():
+def get_identity_auth(username=None, password=None, project=None):
auth_url = os.environ['OS_AUTH_URL']
- username = os.environ['OS_USERNAME']
- password = os.environ['OS_PASSWORD']
+ username = username or os.environ['OS_USERNAME']
+ password = password or os.environ['OS_PASSWORD']
user_domain_name = os.environ.get('OS_USER_DOMAIN_NAME') or 'default'
user_domain_id = os.environ.get('OS_USER_DOMAIN_ID') or 'default'
- project_name = os.environ.get('OS_PROJECT_NAME') or os.environ.get('OS_TENANT_NAME')
+ project_name = project or os.environ.get('OS_PROJECT_NAME') \
+ or os.environ.get('OS_TENANT_NAME')
project_domain_name = os.environ.get('OS_PROJECT_DOMAIN_NAME') or 'default'
project_domain_id = os.environ.get('OS_PROJECT_DOMAIN_ID') or 'default'