]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat common : BaseClient respect host argument
authorSteven Hardy <shardy@redhat.com>
Thu, 7 Mar 2013 12:08:08 +0000 (12:08 +0000)
committerSteven Hardy <shardy@redhat.com>
Thu, 7 Mar 2013 12:12:42 +0000 (12:12 +0000)
Currently the BaseClient class ignores any host argument and overwrites
it with the host from the keystone catalog URL, we should respect the
host parameter if it is passed, but make it optional

ref bug 1102101

Change-Id: I371e3b70a7bd207a177625c3e6855d8504678f1b

heat/common/client.py

index de6dd037f32f553c1803d019ee4b0593870cad45..fd99ad5f23271e1315ffd7d9f78e6bb1c5a8a422 100644 (file)
@@ -171,7 +171,7 @@ class BaseClient(object):
         httplib.TEMPORARY_REDIRECT,
     )
 
-    def __init__(self, host, port=None, use_ssl=False, auth_tok=None,
+    def __init__(self, host=None, port=None, use_ssl=False, auth_tok=None,
                  creds=None, doc_root=None, key_file=None,
                  cert_file=None, ca_file=None, insecure=False,
                  configure_via_auth=True, service_type=None):
@@ -307,7 +307,8 @@ class BaseClient(object):
         """
         parsed = urlparse.urlparse(url)
         self.use_ssl = parsed.scheme == 'https'
-        self.host = parsed.hostname
+        if self.host is None:
+            self.host = parsed.hostname
         self.port = parsed.port or 80
         self.doc_root = parsed.path