From 02759b5251bfc5b7bcfd7cb0090658df3998880b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alo=C3=AFs=20Micard?= Date: Thu, 1 May 2025 11:01:05 +0200 Subject: [PATCH 1/2] Add debug logs --- netbox_pve_sync/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/netbox_pve_sync/__init__.py b/netbox_pve_sync/__init__.py index 906bc41..a3ef3ec 100644 --- a/netbox_pve_sync/__init__.py +++ b/netbox_pve_sync/__init__.py @@ -220,6 +220,10 @@ def _process_pve_virtual_machine_network_interface( _interface_vlan_id: Optional[int], _pve_virtual_machine_ip_addresses: dict, ) -> dict: + print( + f'_process_pve_virtual_machine_network_interface(_nb_api, _nb_objects, {_nb_virtual_machine.serial}, {_interface_name}, {_interface_mac_address}, {_interface_vlan_id}, {_pve_virtual_machine_ip_addresses})' + ) + nb_virtual_machines_interface = _nb_objects['virtual_machines_interfaces'] \ .get(_nb_virtual_machine.id, {}) \ .get(_interface_name) @@ -231,6 +235,10 @@ def _process_pve_virtual_machine_network_interface( description=_interface_mac_address, ) + print( + f'_nb_api.virtualization.interfaces.create(virtual_machine={_nb_virtual_machine.id}, name={_nb_virtual_machine.name}, description={_interface_mac_address}) = {nb_virtual_machines_interface} ({nb_virtual_machines_interface.id})' + ) + if _nb_virtual_machine.id not in _nb_objects['virtual_machines_interfaces']: _nb_objects['virtual_machines_interfaces'][_nb_virtual_machine.id] = {} @@ -246,6 +254,10 @@ def _process_pve_virtual_machine_network_interface( assigned_object_id=nb_virtual_machines_interface.id, ) + print( + f'_nb_api.dcim.mac_addresses.create(mac_address={_interface_mac_address}, assigned_object_type=virtualization.vminterface, assigned_object_id={nb_virtual_machines_interface.id}) = {nb_mac_address}' + ) + _nb_objects['mac_addresses'][_interface_mac_address] = nb_mac_address nb_virtual_machines_interface.primary_mac_address = nb_mac_address.id From 66cfbae8631d01369f65adeb051b59028db705bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alo=C3=AFs=20Micard?= Date: Thu, 1 May 2025 11:01:28 +0200 Subject: [PATCH 2/2] remove workflows --- .forgejo/workflows/cd.yaml | 25 ------------------------- .forgejo/workflows/ci.yaml | 17 ----------------- 2 files changed, 42 deletions(-) delete mode 100644 .forgejo/workflows/cd.yaml delete mode 100644 .forgejo/workflows/ci.yaml diff --git a/.forgejo/workflows/cd.yaml b/.forgejo/workflows/cd.yaml deleted file mode 100644 index 3690493..0000000 --- a/.forgejo/workflows/cd.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: CD - -on: - push: - tags: - - '*' -jobs: - ci: - runs-on: docker - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: '3.13' - cache: 'pip' - - - run: pip install -r requirements.txt - - - run: python3 -m build - - - run: twine upload dist/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} \ No newline at end of file diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml deleted file mode 100644 index 6a0f581..0000000 --- a/.forgejo/workflows/ci.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: CI - -on: [ push ] -jobs: - ci: - runs-on: docker - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: '3.13' - cache: 'pip' - - - run: pip install -r requirements.txt - - - run: pylint --max-line-length=120 netbox_pve_sync \ No newline at end of file