def initLock(self): lockUtil = constants.EXT_SAFELEASE initCommand = [lockUtil, "release", "-f", self._leasesPath, "0"] rc, out, err = misc.execCmd(initCommand, cwd=self.lockUtilPath) if rc != 0: self.log.warn("could not initialise spm lease (%s): %s", rc, out) raise se.ClusterLockInitError()
def initLock(self): lockUtil = os.path.join(self.lockUtilPath, "safelease") initCommand = [lockUtil, "release", "-f", self._leasesPath, "0"] rc, out, err = misc.execCmd(initCommand, cwd=self.lockUtilPath) if rc != 0: self.log.warn("could not initialise spm lease (%s): %s", rc, out) raise se.ClusterLockInitError()
def initLock(cls, path): lockUtil = os.path.join(cls.lockUtilPath, "safelease") initCommand = [lockUtil, "release", "-f", str(path), "0"] rc, out, err = misc.execCmd(initCommand, sudo=False, cwd=cls.lockUtilPath) if rc != 0: cls.log.warn("could not initialise spm lease (%s): %s", rc, out) raise se.ClusterLockInitError()
def initSANLock(sdUUID, idsPath, leasesPath): initSANLockLog.debug("Initializing SANLock for domain %s", sdUUID) try: sanlock.init_lockspace(sdUUID, idsPath) sanlock.init_resource(sdUUID, SDM_LEASE_NAME, [(leasesPath, SDM_LEASE_OFFSET)]) except sanlock.SanlockException: initSANLockLog.error("Cannot initialize SANLock for domain %s", sdUUID, exc_info=True) raise se.ClusterLockInitError()