Beispiel #1
0
 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'
Beispiel #2
0
 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'
Beispiel #3
0
 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)
Beispiel #4
0
 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)
Beispiel #5
0
 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)
Beispiel #6
0
 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)
Beispiel #7
0
 def _get_swift_endpoint(self, service_catalog):
     return auth.get_endpoint(service_catalog, service_type='object-store')
Beispiel #8
0
 def _get_swift_endpoint(self, service_catalog):
     return auth.get_endpoint(service_catalog, service_type='object-store')
Beispiel #9
0
 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)