def configure_add(self): self.container = CONF.swift_store_container if self.context is None: reason = _("Multi-tenant Swift storage requires a context.") raise exception.BadStoreConfiguration(store_name="swift", reason=reason) if self.context.service_catalog is None: reason = _("Multi-tenant Swift storage requires " "a service catalog.") raise exception.BadStoreConfiguration(store_name="swift", reason=reason) self.storage_url = auth.get_endpoint( self.context.service_catalog, service_type=self.service_type, endpoint_region=self.region, endpoint_type=self.endpoint_type) if self.storage_url.startswith('http://'): self.scheme = 'swift+http' else: self.scheme = 'swift+https'
def test_get_endpoint_with_custom_endpoint_type(self): endpoint = auth.get_endpoint(self.service_catalog, service_type='object-store', endpoint_type='internalURL') self.assertEqual('http://internalURL/', endpoint)
def test_get_endpoint_with_custom_server_type(self): endpoint = auth.get_endpoint(self.service_catalog, service_type='object-store') self.assertEqual('http://publicURL/', endpoint)
def test_get_endpoint_with_custom_endpoint_type(self): endpoint = auth.get_endpoint(self.service_catalog, service_type='object-store', endpoint_type='internalURL') self.assertEquals('http://internalURL/', endpoint)
def test_get_endpoint_with_custom_server_type(self): endpoint = auth.get_endpoint(self.service_catalog, service_type='object-store') self.assertEquals('http://publicURL/', endpoint)
def _get_swift_endpoint(self, service_catalog): return auth.get_endpoint(service_catalog, service_type='object-store')
def test_get_endpoint_with_custom_endpoint_type(self): endpoint = auth.get_endpoint(self.service_catalog, service_type="object-store", endpoint_type="internalURL") self.assertEquals("http://internalURL/", endpoint)