Merge pull request #39 from maynero/master

Check if "template" key exists in Proxmox API result
This commit is contained in:
Xabi 2021-09-07 20:53:49 +02:00 committed by GitHub
commit 4f06c2bd9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ class ProxmoxVMList(list):
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]