From 763b4404ef0d043e2931bb5eeec5c575aa1de397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Stocki?= Date: Fri, 18 Jan 2019 12:43:59 +0100 Subject: [PATCH] fixed storage node bug --- PVE-Zabbix.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PVE-Zabbix.py b/PVE-Zabbix.py index 50ba065..7be9e72 100755 --- a/PVE-Zabbix.py +++ b/PVE-Zabbix.py @@ -52,10 +52,9 @@ def exec_storage(**kwargs): # Initiate instances stors = conn.get_cluster_storagelist(nodelist) - # FIXME consider node name to avoid random results from duplicate storage names if kwargs['name'] is not None and kwargs['listing'] is False: try: - stor = next(v for v in stors if v.name == kwargs['name']) + stor = next(v for v in stors if (v.name == kwargs['name'] and v.node == NODE.name)) print stor.get_storageinfo(kwargs['param']) except StopIteration: print "No such VM found. Possible VMs: " + str(VM.get_vmnames(NODE))