summaryrefslogtreecommitdiffstats
path: root/tests/identity_auth.py
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2017-04-13 09:09:41 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2017-05-02 11:01:56 +0800
commitd5918a87f12fdef9bd7408c4554c42606c4896d8 (patch)
treed6b5ce364ae8a425bd3a538655d14872a9f0b0e9 /tests/identity_auth.py
parent51b2ad855f0dad6527e5ec436f6b29758c21fb80 (diff)
add image code
JIRA: DOCTOR-93 Change-Id: I6551d5e31799b967ce442cb05a664c0d64a3dcf8 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'tests/identity_auth.py')
-rw-r--r--tests/identity_auth.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/identity_auth.py b/tests/identity_auth.py
index 4726ca37..0031caec 100644
--- a/tests/identity_auth.py
+++ b/tests/identity_auth.py
@@ -11,6 +11,7 @@ import os
from keystoneauth1.identity import v2
from keystoneauth1.identity import v3
+from keystoneauth1 import session
def get_identity_auth():
@@ -32,3 +33,10 @@ def get_identity_auth():
username=username,
password=password,
tenant_name=project_name)
+
+
+def get_session(auth=None):
+ """Get a user credentials auth session."""
+ if auth is None:
+ auth = get_identity_auth()
+ return session.Session(auth=auth)