Skip to content

Commit

Permalink
Initialize neutron client with region name
Browse files Browse the repository at this point in the history
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
mou committed Apr 18, 2016
1 parent 83fbce4 commit 8c6b5a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openstackclient/network/client.py
Expand Up @@ -14,6 +14,7 @@
import logging

from openstack import connection
from openstack import profile

from openstackclient.common import utils

Expand All @@ -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)
Expand Down

0 comments on commit 8c6b5a0

Please sign in to comment.