add image code
[doctor.git] / tests / os_clients.py
diff --git a/tests/os_clients.py b/tests/os_clients.py
new file mode 100644 (file)
index 0000000..2eb406e
--- /dev/null
@@ -0,0 +1,21 @@
+##############################################################################\r
+# Copyright (c) 2017 ZTE Corporation and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+from oslo_config import cfg\r
+\r
+import glanceclient.client as glanceclient\r
+\r
+\r
+OPTS = [\r
+    cfg.StrOpt('glance_version', default='2', help='glance version'),\r
+]\r
+\r
+\r
+def glance_client(version, session):\r
+    return glanceclient.Client(version=version,\r
+                               session=session)\r