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 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 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 selftest(self): """ Run internal self test """ if not mount.isMounted(self.mountpoint): raise se.StorageDomainFSNotMounted(self.mountpoint) # Run general part of selftest fileSD.FileStorageDomain.selftest(self)
def _preCreateValidation(cls, sdUUID, domPath, typeSpecificArg, version): # Some trivial resource validation if ":" not in typeSpecificArg: raise se.StorageDomainIllegalRemotePath(typeSpecificArg) sd.validateDomainVersion(version) # Make sure the underlying file system is mounted if not mount.isMounted(domPath): raise se.StorageDomainFSNotMounted(domPath) fileSD.validateDirAccess(domPath) # Make sure there are no remnants of other domain mdpat = os.path.join(domPath, "*", sd.DOMAIN_META_DATA) if len(oop.getProcessPool(sdUUID).glob.glob(mdpat)) > 0: raise se.StorageDomainNotEmpty(typeSpecificArg)
def _preCreateValidation(cls, sdUUID, domPath, typeSpecificArg, storageType, version): # Some trivial resource validation # TODO Checking storageType==nfs in the nfs class is not clean if storageType == sd.NFS_DOMAIN and ":" not in typeSpecificArg: raise se.StorageDomainIllegalRemotePath(typeSpecificArg) sd.validateDomainVersion(version) # Make sure the underlying file system is mounted if not mount.isMounted(domPath): raise se.StorageDomainFSNotMounted(domPath) fileSD.validateDirAccess(domPath) fileSD.validateFileSystemFeatures(sdUUID, domPath) # Make sure there are no remnants of other domain mdpat = os.path.join(domPath, "*", sd.DOMAIN_META_DATA) if len(oop.getProcessPool(sdUUID).glob.glob(mdpat)) > 0: raise se.StorageDomainNotEmpty(typeSpecificArg)
def validateMasterMount(self): return mount.isMounted(self.getMasterDir())