summaryrefslogtreecommitdiffstats
path: root/tests/identity_auth.py
diff options
context:
space:
mode:
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'