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)
def validateDomainVersion(version): if version not in constants.SUPPORTED_DOMAIN_VERSIONS: raise se.UnsupportedDomainVersion(version)
def hasVolumeLeases(self): domVersion = self.getVersion() try: return self._clusterLockTable[domVersion][1] except KeyError: raise se.UnsupportedDomainVersion(domVersion)