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
This commit is contained in:
Andrey Larionov 2016-04-15 21:23:20 +03:00
parent 83fbce496a
commit 8c6b5a087a
1 changed files with 5 additions and 1 deletions

View File

@ -14,6 +14,7 @@
import logging
from openstack import connection
from openstack import profile
from openstackclient.common import utils
@ -31,8 +32,11 @@ API_VERSIONS = {
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)