add test user, project and role
[doctor.git] / tests / os_clients.py
1 ##############################################################################\r
2 # Copyright (c) 2017 ZTE Corporation and others.\r
3 #\r
4 # All rights reserved. This program and the accompanying materials\r
5 # are made available under the terms of the Apache License, Version 2.0\r
6 # which accompanies this distribution, and is available at\r
7 # http://www.apache.org/licenses/LICENSE-2.0\r
8 ##############################################################################\r
9 from oslo_config import cfg\r
10 \r
11 import glanceclient.client as glanceclient\r
12 from keystoneclient.v2_0 import client as ks_client\r
13 import novaclient.client as novaclient\r
14 \r
15 OPTS = [\r
16     cfg.StrOpt('glance_version', default='2', help='glance version'),\r
17     cfg.StrOpt('nova_version', default='2.34', help='Nova version'),\r
18 ]\r
19 \r
20 \r
21 def glance_client(version, session):\r
22     return glanceclient.Client(version=version,\r
23                                session=session)\r
24 \r
25 \r
26 def keystone_client(session):\r
27     return ks_client.Client(session=session)\r
28 \r
29 \r
30 def nova_client(version, session):\r
31     return novaclient.Client(version=version,\r
32                              session=session)\r