1 ##############################################################################
\r
2 # Copyright (c) 2017 ZTE Corporation and others.
\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
11 import aodhclient.client as aodhclient
\r
12 from congressclient.v1 import client as congressclient
\r
13 import glanceclient.client as glanceclient
\r
14 import heatclient.client as heatclient
\r
15 from keystoneclient import client as ks_client
\r
16 from neutronclient.v2_0 import client as neutronclient
\r
17 import novaclient.client as novaclient
\r
18 import vitrageclient.client as vitrageclient
\r
22 cfg.StrOpt('glance_version', default='2', help='glance version'),
\r
23 cfg.StrOpt('nova_version', default='2.34', help='Nova version'),
\r
24 cfg.StrOpt('aodh_version', default='2', help='aodh version'),
\r
25 cfg.StrOpt('vitrage_version', default='1', help='vitrage version'),
\r
26 cfg.StrOpt('keystone_version', default='v3', help='keystone version'),
\r
27 cfg.StrOpt('heat_version', default='1', help='heat version'),
\r
31 def glance_client(version, session):
\r
32 return glanceclient.Client(version=version,
\r
36 def heat_client(version, session):
\r
37 return heatclient.Client(version=version,
\r
41 def keystone_client(version, session):
\r
42 return ks_client.Client(version=version,
\r
46 def nova_client(version, session):
\r
47 return novaclient.Client(version=version,
\r
51 def neutron_client(session):
\r
52 return neutronclient.Client(session=session)
\r
55 def aodh_client(version, session):
\r
56 return aodhclient.Client(version, session=session)
\r
59 def congress_client(session):
\r
60 return congressclient.Client(session=session,
\r
61 service_type='policy')
\r
64 def vitrage_client(version, session):
\r
65 return vitrageclient.Client(version=version,
\r