python-compute/node_agent/exceptions.py
2023-06-17 20:07:50 +03:00

35 lines
1020 B
Python

class VMNotFound(Exception):
def __init__(self, domain, message='VM not found: {domain}'):
self.domain = domain
self.message = message.format(domain=domain)
super().__init__(self.message)
class VMStartError(Exception):
def __init__(self, domain, message='VM start error: {domain}'):
self.domain = domain
self.message = message.format(domain=domain)
super().__init__(self.message)
class VMShutdownError(Exception):
def __init__(
self,
domain,
message="VM '{domain}' cannot shutdown, try with hard=True"
):
self.domain = domain
self.message = message.format(domain=domain)
super().__init__(self.message)
class VMRebootError(Exception):
def __init__(
self,
domain,
message="VM '{domain}' reboot, try with hard=True",
):
self.domain = domain
self.message = message.format(domain=domain)
super().__init__(self.message)