def _findUnfetchedDomain(self, sdUUID): import blockSD import glusterSD import localFsSD import nfsSD self.log.error("looking for domain %s", sdUUID) # The order is somewhat important, it's ordered # by how quickly get can find the domain. For instance # if an nfs mount is unavailable we will get stuck # until it times out, this should affect fetching # of block\local domains. If for any case in the future # this changes, please update the order. for mod in (blockSD, glusterSD, localFsSD, nfsSD): try: return mod.findDomain(sdUUID) except se.StorageDomainDoesNotExist: pass except Exception: self.log.error("Error while looking for domain `%s`", sdUUID, exc_info=True) raise se.StorageDomainDoesNotExist(sdUUID)
def findDomainPath(sdUUID): for tmpSdUUID, domainPath in fileSD.scanDomains("_*"): if tmpSdUUID == sdUUID: return domainPath else: raise se.StorageDomainDoesNotExist(sdUUID)
def produce(self, sdUUID): try: return self.domains[sdUUID] except KeyError: raise se.StorageDomainDoesNotExist(sdUUID)