diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-03-24 14:43:04 +0800 |
---|---|---|
committer | Serena Feng <feng.xiaowei@zte.com.cn> | 2017-03-24 06:45:51 +0000 |
commit | 9b44406394c56b4d162e3feae6282777a63b5ec0 (patch) | |
tree | d3490377159970205a3a309c22158590f9286d32 /deploy/post/neutron.py | |
parent | bbef0fa1fb89a90a98e66ece5b19852bcf3f2332 (diff) |
unify the way of getting openstack clients
Change-Id: If3a1d1a8b74e11c5861c016bd722b78f4cf9b475
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'deploy/post/neutron.py')
-rw-r--r-- | deploy/post/neutron.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/deploy/post/neutron.py b/deploy/post/neutron.py index dc2e30b2..77791ea8 100644 --- a/deploy/post/neutron.py +++ b/deploy/post/neutron.py @@ -6,16 +6,15 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -from neutronclient.neutron import client as neutronclient +from neutronclient.neutron import client from deploy.common import query import keystoneauth -class Neutron(object): - def __init__(self, api_v='2', openrc=None): - session = keystoneauth.Keystoneauth(openrc).session - self.client = neutronclient.Client(api_v, session=session) +class Neutron(keystoneauth.ClientBase): + def __init__(self, version='2', openrc=None): + super(Neutron, self).__init__(client.Client, version, openrc) def create_network(self, name, body): if not self.get_network_by_name(name): |