summaryrefslogtreecommitdiff
path: root/openstackclient/network/client.py
diff options
context:
space:
mode:
authorStuart McLaren <stuart.mclaren@hp.com>2016-06-14 11:16:12 +0000
committerSteve Martinelli <s.martinelli@gmail.com>2017-01-17 12:36:14 +0000
commitebf4c7f255347147988e8f1e41f162ade6c2a5ed (patch)
treeacb11343643957da0d6e13324c6283acfb6b203d /openstackclient/network/client.py
parent53a79c33f88cea83fb2a90408dd3f5e8dd48a2f5 (diff)
downloadpython-openstackclient-ebf4c7f255347147988e8f1e41f162ade6c2a5ed.tar.gz
Ensure endpoint type is used for network commands
Currently OS_ENDPOINT_TYPE and --os-interface are being ignored for network commands. This means the public URL is always used. Make sure that these are picked up correctly so we hit the correct endpoint (internal/admin/etc.) for commands such as: $ openstack --os-interface internal network list Closes-bug: 1592368 (cherry picked from commit 7c603e4a67c3d44367afbf2f2f6811d2436295e0) Change-Id: Iac05204e3056e386d84d3644b5da1a2bb322bb0a
Diffstat (limited to 'openstackclient/network/client.py')
-rw-r--r--openstackclient/network/client.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/openstackclient/network/client.py b/openstackclient/network/client.py
index dca9efc4..3ad3eea4 100644
--- a/openstackclient/network/client.py
+++ b/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,13 @@ 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])
+ prof.set_interface(API_NAME, instance._interface)
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)