Adding interface type to client object

This fix will allow us to pass 'os_interface' as an env variable
or as a commandline argument based on which the appropriate cue
endpoint will be used.If its not passed by default public endpoint
will be used.

Change-Id: I9c886304799a63926812f8f678016fcc0775cfa7
This commit is contained in:
Abitha Palaniappan 2015-10-26 22:00:48 -07:00
parent f6f9106d97
commit f65feb0b37
2 changed files with 6 additions and 3 deletions

View File

@ -31,7 +31,7 @@ def make_client(instance):
cls = oscutils.get_client_class(
API_NAME, instance._api_version[API_NAME],
API_VERSIONS)
return cls(session=instance.session)
return cls(session=instance.session, interface=instance._interface)
def build_option_parser(parser):

View File

@ -23,13 +23,16 @@ class Client(object):
def __init__(self, region_name=None, endpoint_type='publicURL',
extensions=None, service_type='message-broker',
service_name=None, http_log_debug=False, session=None,
auth=None):
auth=None, interface=None):
if interface is None:
interface = endpoint_type.rstrip('URL')
self.session = adapter.Adapter(
session,
auth=auth,
region_name=region_name,
service_type=service_type,
interface=endpoint_type.rstrip('URL'),
interface=interface,
user_agent='python-cueclient-%s' % version.version_info,
version=('1'))