Only initialize the glance_http if service is enabled
This commit just adds a check to see if glance is set as enabled in the config file before initializing the glance http client. Previously regardless of whether glance was enabled or not glance_http would auth against keystone. Closes-Bug: #1214774 Change-Id: I07127c21d55d58fdb294468a0b74ce2bc54d8719
This commit is contained in:
@@ -36,7 +36,8 @@ class ImageClientJSON(RestClient):
|
||||
super(ImageClientJSON, self).__init__(config, username, password,
|
||||
auth_url, tenant_name)
|
||||
self.service = self.config.images.catalog_type
|
||||
self.http = self._get_http()
|
||||
if config.service_available.glance:
|
||||
self.http = self._get_http()
|
||||
|
||||
def _image_meta_from_headers(self, headers):
|
||||
meta = {'properties': {}}
|
||||
|
||||
@@ -31,7 +31,8 @@ class ImageClientV2JSON(rest_client.RestClient):
|
||||
super(ImageClientV2JSON, self).__init__(config, username, password,
|
||||
auth_url, tenant_name)
|
||||
self.service = self.config.images.catalog_type
|
||||
self.http = self._get_http()
|
||||
if config.service_available.glance:
|
||||
self.http = self._get_http()
|
||||
|
||||
def _get_http(self):
|
||||
token, endpoint = self.keystone_auth(self.user, self.password,
|
||||
|
||||
Reference in New Issue
Block a user