1
0
Fork 0
mirror of https://github.com/ThomasGsp/HyperProxmox.git synced 2025-02-13 03:32:16 +00:00

Proxmox 4 compatibility

This commit is contained in:
Tlams 2018-02-23 21:10:30 +00:00
parent 2086a0aa48
commit 04f03dc3bb

View file

@ -155,10 +155,15 @@ class Analyse:
node_status["totalalloccpu"] = totalcpu
node_status["totalallocram"] = totalram
node_status["vmcount"] = len(list_instances["data"])
node_status["status"] = value_nodes_list["status"]
node_status["type"] = value_nodes_list["type"]
node_status["node"] = value_nodes_list["node"]
""" Proxmox-v4 compatibility """
try:
node_status["status"] = value_nodes_list["status"]
except BaseException:
node_status["status"] = "Online"
percent_cpu_alloc = (totalcpu / value_nodes_list["maxcpu"]) * 100
percent_ram_alloc = (totalram / value_nodes_list["mem"]) * 100