示例#1
0
    def _makeDomainLock(self, domVersion=None):
        if not domVersion:
            domVersion = self.getVersion()

        leaseParams = (
            DEFAULT_LEASE_PARAMS[DMDK_LOCK_RENEWAL_INTERVAL_SEC],
            DEFAULT_LEASE_PARAMS[DMDK_LEASE_TIME_SEC],
            DEFAULT_LEASE_PARAMS[DMDK_LEASE_RETRIES],
            DEFAULT_LEASE_PARAMS[DMDK_IO_OP_TIMEOUT_SEC],
        )

        try:
            lockClass = self._domainLockTable[domVersion]
        except KeyError:
            raise se.UnsupportedDomainVersion(domVersion)

        return lockClass(self.sdUUID, self.getIdsFilePath(),
                         self.getLeasesFilePath(), *leaseParams)
示例#2
0
def validateDomainVersion(version):
    if version not in constants.SUPPORTED_DOMAIN_VERSIONS:
        raise se.UnsupportedDomainVersion(version)
示例#3
0
文件: sd.py 项目: rexhsu/vdsm-debian
 def hasVolumeLeases(self):
     domVersion = self.getVersion()
     try:
         return self._clusterLockTable[domVersion][1]
     except KeyError:
         raise se.UnsupportedDomainVersion(domVersion)