Verified Commit 3ea28f73 authored by Jennifer Graul's avatar Jennifer Graul
Browse files

added proxmox 7 compatibility

parent 458bdcda
...@@ -20,7 +20,7 @@ def print_dw_table(vmdata): ...@@ -20,7 +20,7 @@ def print_dw_table(vmdata):
line = line + '[[technik:server:{0}|{0}]]'.format(data['name']) line = line + '[[technik:server:{0}|{0}]]'.format(data['name'])
line = line + ' | ' line = line + ' | '
lastnet = len(data['net']) - 1 lastnet = len(data['net']) - 1
for idx, net in enumerate(data['net']): for idx, net in enumerate(sorted(data['net'])):
if idx != lastnet: if idx != lastnet:
line = line + net + ' \\\\ ' line = line + net + ' \\\\ '
else: else:
...@@ -114,7 +114,7 @@ def main(): ...@@ -114,7 +114,7 @@ def main():
vms = pve.nodes(args.node).qemu.get() vms = pve.nodes(args.node).qemu.get()
vmdata = dict() vmdata = dict()
for vm in vms: for vm in vms:
if not vm['template']: if 'template' not in vm or not vm['template']:
vmdata[vm['vmid']] = dict() vmdata[vm['vmid']] = dict()
acls = pve.access.acl.get() acls = pve.access.acl.get()
...@@ -153,9 +153,9 @@ def main(): ...@@ -153,9 +153,9 @@ def main():
data['comment'] = desc['comment'] data['comment'] = desc['comment']
data['users'] = list() data['users'] = list()
for acl in acls: for acl in acls:
if acl['path'] == '/vms/' + vmid and acl['type'] == 'user': if acl['path'] == '/vms/' + str(vmid) and acl['type'] == 'user':
data['users'].append(acl['ugid']) data['users'].append(acl['ugid'])
elif acl['path'] == '/vms/' + vmid and acl['type'] == 'group': elif acl['path'] == '/vms/' + str(vmid) and acl['type'] == 'group':
data['users'] = data['users'] + usedgroups[acl['ugid']] data['users'] = data['users'] + usedgroups[acl['ugid']]
print_dw_table(vmdata) print_dw_table(vmdata)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment