示例#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'
示例#2
0
文件: swift.py 项目: vmcloud/glance
 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'
示例#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)
示例#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)
示例#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)
示例#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)
示例#7
0
文件: swift.py 项目: stateman/glance
 def _get_swift_endpoint(self, service_catalog):
     return auth.get_endpoint(service_catalog, service_type='object-store')
示例#8
0
文件: swift.py 项目: ameade/glance
 def _get_swift_endpoint(self, service_catalog):
     return auth.get_endpoint(service_catalog, service_type='object-store')
示例#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)