-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathproxcli_exceptions.py
More file actions
executable file
·96 lines (78 loc) · 2.74 KB
/
proxcli_exceptions.py
File metadata and controls
executable file
·96 lines (78 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env python
"""Custom proxcli exceptions"""
class VmWaitForStatusTimeoutException(Exception):
"""occur when waiting for vm status elapsed
time is greater than timeout argument"""
def __init__(
self,
message="Waiting for vm status timeout."
) -> None:
self.message = message
super().__init__(self.message)
class VmIdentificationException(Exception):
"""raised when we have the choice between a filter
or a vmid to specify vm selection and neither
vmid nor filter_name is specified"""
def __init__(
self,
message="You must specify one of vmid or filter options"
) -> None:
self.message = message
super().__init__(self.message)
class VmIdMutualyExclusiveException(Exception):
"""raised when we have the choice between a filter
or a vmid to specify vm selection and both are specified"""
def __init__(
self,
message="vmid and filter options are mutualy exclusive"
) -> None:
self.message = message
super().__init__(self.message)
class ProxmoxClusterDownException(Exception):
"""raised when we have no proxmox node availabale"""
def __init__(
self,
message="No nodes available"
) -> None:
self.message = message
super().__init__(self.message)
class ProxmoxVmNotFoundException(Exception):
"""raised when we have no proxmox node availabale"""
def __init__(
self,
message="virtual machine not found"
) -> None:
self.message = message
super().__init__(self.message)
class ProxmoxVmMigrateFailedException(Exception):
"""raised when we vm migration fail"""
def __init__(
self,
message="virtual machine not found"
) -> None:
self.message = message
super().__init__(self.message)
class ProxmoxVmNeedStopException(Exception):
"""raised when we an action on a vm need first to stop the vm"""
def __init__(
self,
message="virtual machine must be stopped before action"
) -> None:
self.message = message
super().__init__(self.message)
class ProxmoxVmConfigGetException(Exception):
"""raised when we can't get virtual machine config"""
def __init__(
self,
message="Virtual machine config could not be loaded"
) -> None:
self.message = message
super().__init__(self.message)
class ProxmoxVmGetNetIfacesException(Exception):
"""raised when we can't get virtual machine interfaces"""
def __init__(
self,
message="Could not retrieve Net Ifaces list"
) -> None:
self.message = message
super().__init__(self.message)