Permalink
Browse files

Initialize neutron client with region name

All clients except neutron are initialized with region name.
This makes unable to use network related commands of
openstackclient in multi-region configurations

Change-Id: I200dc9a2f938c3e69357f91c79810df167e4fccb
Closes-bug: 1570491
  • Loading branch information...
1 parent 83fbce4 commit 8c6b5a087a4b0dca16faffdbcb5fc9f2d424ddf8 @mou mou committed Apr 15, 2016
Showing with 5 additions and 1 deletion.
  1. +5 −1 openstackclient/network/client.py
@@ -14,6 +14,7 @@
import logging
from openstack import connection
+from openstack import profile
from openstackclient.common import utils
@@ -31,8 +32,11 @@
def make_client(instance):
"""Returns a network proxy"""
+ prof = profile.Profile()
+ prof.set_region(API_NAME, instance._region_name)
+ prof.set_version(API_NAME, instance._api_version[API_NAME])
conn = connection.Connection(authenticator=instance.session.auth,
- verify=instance.session.verify)
+ verify=instance.session.verify, profile=prof)
LOG.debug('Connection: %s', conn)
LOG.debug('Network client initialized using OpenStack SDK: %s',
conn.network)

0 comments on commit 8c6b5a0

Please sign in to comment.