netdevopsbr / netbox-proxbox

Netbox Plugin for integration between Proxmox and Netbox
Apache License 2.0
338 stars 50 forks source link

Fix Virtual Machine ID selection and minor bug #87

Closed Gskill75 closed 1 year ago

Gskill75 commented 1 year ago

Hello, I have corrected these errors:

"GET /api/virtualization/interfaces/?virtual_machine=6&name=net0&limit=0 HTTP/1.1" 400 85 "-" "python-requests/2.28.2"
The request failed with code 400 Bad Request: {'virtual_machine': ['Select a valid choice. 6 is not one of the available choices.']}

File "/opt/netbox/venv/lib/python3.10/site-packages/netbox_proxbox/proxbox_api/updates/virtual_machine.py", line 327, in interfaces
    _ntb_if.append({'name': interface.name, 'mac_address': interface.mac_address.lower(), 'mtu': interface.mtu})
AttributeError: 'NoneType' object has no attribute 'lower'

for the second error I just deleted the lower. To improve it would be necessary to see to convert the mac in strings if it is really necessary.

emersonfelipesp commented 1 year ago

Thank you @Gskill75 for your contribution!