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:
parent
f6f9106d97
commit
f65feb0b37
|
@ -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):
|
||||
|
|
|
@ -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'))
|
||||
|
||||
|
|
Loading…
Reference in New Issue