def findDomainPath(sdUUID): try: vg = lvm.getVG(sdUUID) except se.VolumeGroupDoesNotExist: raise se.StorageDomainDoesNotExist(sdUUID) if _isSD(vg): return vg.name raise se.StorageDomainDoesNotExist(sdUUID)
def findDomainPath(sdUUID): for tmpSdUUID, domainPath in fileSD.scanDomains("*"): if tmpSdUUID == sdUUID and mount.isMounted( os.path.join(domainPath, "..")): return domainPath raise se.StorageDomainDoesNotExist(sdUUID)
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): glusterDomPath = os.path.join(sd.GLUSTERSD_DIR, "*") for tmpSdUUID, domainPath in fileSD.scanDomains(glusterDomPath): if tmpSdUUID == sdUUID and mount.isMounted( os.path.join(domainPath, "..")): return domainPath raise se.StorageDomainDoesNotExist(sdUUID)
def getDomPath(sdUUID): pattern = os.path.join(sd.StorageDomain.storage_repository, sd.DOMAIN_MNT_POINT, '*', sdUUID) # Warning! You need a global proc pool big as the number of NFS domains. domPaths = getProcPool().glob.glob(pattern) if len(domPaths) == 0: raise se.StorageDomainDoesNotExist(sdUUID) elif len(domPaths) > 1: raise se.StorageDomainLayoutError(sdUUID) else: return domPaths[0]
def findDomainPath(sdUUID): for tmpSdUUID, domainPath in fileSD.scanDomains("_*"): if tmpSdUUID == sdUUID: return domainPath else: raise se.StorageDomainDoesNotExist(sdUUID)