fixed storage node bug

This commit is contained in:
Miłosz Stocki 2019-01-18 12:43:59 +01:00
parent bb0083b60d
commit 763b4404ef
Signed by: osiu97
GPG Key ID: E3D1D83FA04F51D6
1 changed files with 1 additions and 2 deletions

View File

@ -52,10 +52,9 @@ def exec_storage(**kwargs):
# Initiate instances # Initiate instances
stors = conn.get_cluster_storagelist(nodelist) 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: if kwargs['name'] is not None and kwargs['listing'] is False:
try: 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']) print stor.get_storageinfo(kwargs['param'])
except StopIteration: except StopIteration:
print "No such VM found. Possible VMs: " + str(VM.get_vmnames(NODE)) print "No such VM found. Possible VMs: " + str(VM.get_vmnames(NODE))