Exemplo n.º 1
0
Arquivo: sd.py Projeto: rexhsu/vdsm
    def _registerResourceNamespaces(self):
        """
        Register resources namespaces and create
        factories for it.
        """
        rmanager = rm.ResourceManager.getInstance()
        # Register image resource namespace
        imageResourceFactory = \
            resourceFactories.ImageResourceFactory(self.sdUUID)
        imageResourcesNamespace = getNamespace(self.sdUUID, sc.IMAGE_NAMESPACE)
        try:
            rmanager.registerNamespace(imageResourcesNamespace,
                                       imageResourceFactory)
        except KeyError:
            self.log.info("Resource namespace %s already registered",
                          imageResourcesNamespace)

        volumeResourcesNamespace = getNamespace(self.sdUUID,
                                                sc.VOLUME_NAMESPACE)
        try:
            rmanager.registerNamespace(volumeResourcesNamespace,
                                       rm.SimpleResourceFactory())
        except KeyError:
            self.log.info("Resource namespace %s already registered",
                          volumeResourcesNamespace)
Exemplo n.º 2
0
 def __init__(self):
     self.storage_repository = config.get('irs', 'repository')
     resourceManager.ResourceManager.getInstance().registerNamespace(
         STORAGE, resourceManager.SimpleResourceFactory())
     self.hsm = hsm.HSM()
     self._init_public_functions()
     self.log.info("Starting StorageDispatcher...")