Beispiel #1
0
def create_resource():
    """Images resource factory method"""
    plugins = loader.ArtifactsPluginLoader('glance.artifacts.types')
    deserializer = RequestDeserializer(plugins=plugins)
    serializer = ResponseSerializer()
    controller = ArtifactsController(plugins=plugins)
    return wsgi.Resource(controller, deserializer, serializer)
Beispiel #2
0
 def __init__(self, db_api=None, store_api=None, plugins=None):
     self.db_api = db_api or glance.db.get_api()
     self.store_api = store_api or glance_store
     self.plugins = plugins or loader.ArtifactsPluginLoader(
         'glance.artifacts.types')
     self.gateway = gateway.Gateway(self.db_api, self.store_api,
                                    self.plugins)
Beispiel #3
0
 def _setup_loader(self, artifacts):
     self.loader = None
     mock_this = 'stevedore.extension.ExtensionManager._find_entry_points'
     with mock.patch(mock_this) as fep:
         fep.return_value = [
             pkg_resources.EntryPoint.parse(art) for art in artifacts]
         self.loader = loader.ArtifactsPluginLoader(
             'glance.artifacts.types')
Beispiel #4
0
 def __init__(self, schema=None, plugins=None):
     super(RequestDeserializer,
           self).__init__(methods_allowed=["replace", "remove", "add"])
     self.plugins = plugins or loader.ArtifactsPluginLoader(
         'glance.artifacts.types')