Skip to content

Commit

Permalink
Merge pull request #39 from maynero/master
Browse files Browse the repository at this point in the history
Check if "template" key exists in Proxmox API result
  • Loading branch information
xezpeleta authored Sep 7, 2021
2 parents d7b0139 + 83005f4 commit 4f06c2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxmox.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, data=[], pxmxver=0.0):

def get_names(self):
if self.ver >= 4.0:
return [vm['name'] for vm in self if vm['template'] != 1]
return [vm['name'] for vm in self if 'template' in vm and vm['template'] != 1]
else:
return [vm['name'] for vm in self]

Expand Down

0 comments on commit 4f06c2b

Please sign in to comment.