From 405e8d8772336c761a27a6acbd223ce94a87f613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alo=C3=AFs=20Micard?= Date: Tue, 18 Feb 2025 18:06:00 +0100 Subject: [PATCH] Allow to report autostart --- app/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/__main__.py b/app/__main__.py index b303e32..8387a8b 100644 --- a/app/__main__.py +++ b/app/__main__.py @@ -123,7 +123,10 @@ def _process_pve_virtual_machine( vcpus=pve_virtual_machine_config['cores'], memory=int(pve_virtual_machine_config['memory']), status='active' if _pve_virtual_machine['status'] == 'running' else 'offline', - tags=list(map(lambda _pve_tag_name: _nb_objects['tags'][_pve_tag_name], _pve_tags)) + tags=list(map(lambda _pve_tag_name: _nb_objects['tags'][_pve_tag_name], _pve_tags)), + custom_fields={ + 'autostart': pve_virtual_machine_config.get('onboot') == 1, + } ) else: nb_virtual_machine.name = _pve_virtual_machine['name'] @@ -134,6 +137,7 @@ def _process_pve_virtual_machine( nb_virtual_machine.memory = int(pve_virtual_machine_config['memory']) nb_virtual_machine.status = 'active' if _pve_virtual_machine['status'] == 'running' else 'offline' nb_virtual_machine.tags = list(map(lambda _pve_tag_name: _nb_objects['tags'][_pve_tag_name], _pve_tags)) + nb_virtual_machine.custom_fields['autostart'] = pve_virtual_machine_config.get('onboot') == 1 nb_virtual_machine.save() # Handle the VM network interfaces