def _stopDev(self): host = self.host vmid = self.getVmid() state = vzctl.getState(host, vmid) if state == State.STARTED: vzctl.stop(host, vmid) state = vzctl.getState(host, vmid) self.state = State.PREPARED self.save() if self.getVncPort(): vzctl.stopVnc(host, vmid, self.getVncPort()) self._unassignVncPort()
def _stopVnc(self): assert self.host and self.getVmid() and self.getVncPort() vzctl.stopVnc(self.host, self.getVmid(), self.getVncPort()) self.host.giveId("port", self.getVncPort()) self.setVncPort(None)
def _stopVnc(self): if not self.host or not self.getVmid() or not self.getVncPort(): return vzctl.stopVnc(self.host, self.getVmid(), self.getVncPort()) self._unassignVncPort()
def _stopVnc(self): if not self.host or not self.getVmid() or not self.getVncPort(): return vzctl.stopVnc(self.host, self.getVmid(), self.getVncPort()) self.host.giveId("port", self.getVncPort()) self.setVncPort(None)