@@ -12,7 +12,7 @@ class HypervisorProperties(PropEnum):
12
12
An enum class for all hypervisor properties
13
13
"""
14
14
15
- HYPERVISOR_CURRENT_WORKLOAD = auto ()
15
+ # HYPERVISOR_CURRENT_WORKLOAD = auto()
16
16
HYPERVISOR_DISK_FREE = auto ()
17
17
HYPERVISOR_DISK_SIZE = auto ()
18
18
HYPERVISOR_DISK_USED = auto ()
@@ -35,10 +35,10 @@ def _get_aliases() -> Dict:
35
35
A method that returns all valid string alias mappings
36
36
"""
37
37
return {
38
- HypervisorProperties .HYPERVISOR_CURRENT_WORKLOAD : [
39
- "current_workload" ,
40
- "workload" ,
41
- ],
38
+ # HypervisorProperties.HYPERVISOR_CURRENT_WORKLOAD: [
39
+ # "current_workload",
40
+ # "workload",
41
+ # ],
42
42
HypervisorProperties .HYPERVISOR_DISK_FREE : [
43
43
"local_disk_free" ,
44
44
"free_disk_gb" ,
@@ -74,39 +74,39 @@ def get_prop_mapping(prop) -> Optional[PropFunc]:
74
74
:param prop: A HypervisorProperty Enum for which a function may exist for
75
75
"""
76
76
mapping = {
77
- HypervisorProperties .HYPERVISOR_CURRENT_WORKLOAD : lambda a : a [
78
- "current_workload"
77
+ # HypervisorProperties.HYPERVISOR_CURRENT_WORKLOAD: lambda a: a[
78
+ # "current_workload"
79
+ # ],
80
+ HypervisorProperties .HYPERVISOR_DISK_FREE : lambda a : a .resources ["DISK_GB" ][
81
+ "free"
82
+ ],
83
+ HypervisorProperties .HYPERVISOR_DISK_SIZE : lambda a : a .resources ["DISK_GB" ][
84
+ "total"
85
+ ],
86
+ HypervisorProperties .HYPERVISOR_DISK_USED : lambda a : a .resources ["DISK_GB" ][
87
+ "usage"
79
88
],
80
- HypervisorProperties .HYPERVISOR_DISK_FREE : lambda a : a .resources .get (
81
- "DISK_GB"
82
- ).get ("free" , None ),
83
- HypervisorProperties .HYPERVISOR_DISK_SIZE : lambda a : a .resources .get (
84
- "DISK_GB"
85
- ).get ("total" , None ),
86
- HypervisorProperties .HYPERVISOR_DISK_USED : lambda a : a .resources .get (
87
- "DISK_GB"
88
- ).get ("usage" , None ),
89
89
HypervisorProperties .HYPERVISOR_ID : lambda a : a ["id" ],
90
90
HypervisorProperties .HYPERVISOR_IP : lambda a : a ["host_ip" ],
91
- HypervisorProperties .HYPERVISOR_MEMORY_FREE : lambda a : a .resources . get (
91
+ HypervisorProperties .HYPERVISOR_MEMORY_FREE : lambda a : a .resources [
92
92
"MEMORY_MB"
93
- ). get ( "free" , None ) ,
94
- HypervisorProperties .HYPERVISOR_MEMORY_SIZE : lambda a : a .resources . get (
93
+ ][ "free" ] ,
94
+ HypervisorProperties .HYPERVISOR_MEMORY_SIZE : lambda a : a .resources [
95
95
"MEMORY_MB"
96
- ). get ( "total" , None ) ,
97
- HypervisorProperties .HYPERVISOR_MEMORY_USED : lambda a : a .resources . get (
96
+ ][ "total" ] ,
97
+ HypervisorProperties .HYPERVISOR_MEMORY_USED : lambda a : a .resources [
98
98
"MEMORY_MB"
99
- ). get ( "usage" , None ) ,
99
+ ][ "usage" ] ,
100
100
HypervisorProperties .HYPERVISOR_NAME : lambda a : a ["name" ],
101
101
# HypervisorProperties.HYPERVISOR_SERVER_COUNT: lambda a: a["runnning_vms"],
102
102
HypervisorProperties .HYPERVISOR_STATE : lambda a : a ["state" ],
103
103
HypervisorProperties .HYPERVISOR_STATUS : lambda a : a ["status" ],
104
- HypervisorProperties .HYPERVISOR_VCPUS : lambda a : a .resources . get (
105
- "VCPU "
106
- ). get ( "total" , None ) ,
107
- HypervisorProperties .HYPERVISOR_VCPUS_USED : lambda a : a .resources . get (
108
- "VCPU "
109
- ). get ( "usage" , None ) ,
104
+ HypervisorProperties .HYPERVISOR_VCPUS : lambda a : a .resources [ "VCPU" ][
105
+ "total "
106
+ ] ,
107
+ HypervisorProperties .HYPERVISOR_VCPUS_USED : lambda a : a .resources [ "VCPU" ][
108
+ "usage "
109
+ ] ,
110
110
HypervisorProperties .HYPERVISOR_DISABLED_REASON : lambda a : a ["service" ][
111
111
"disabled_reason"
112
112
],
0 commit comments