fix: skip_host_nics must skip only the physical interfaces, not the host - #555
Conversation
|
This appears to add the missing parts for #442. And I would leave it as it is. If the user decides to flip this option once hosts are already synced then the user needs to decide what to do with the inconstent data. You could keep the interfaces by removing the source tag, or just let netbox-sync take care of it and delete orphan objects. Not sure what's the better approach here. |
|
Agreed. I put exactly those two choices into the example-config comment (remove the source tag to keep the interfaces, or let the prune run remove them as orphaned) and merged after CI. |
|
One option to avoid the inconsistent state altogether, if you want it: while Three possible behaviours, for you to pick:
I'd go with 2, it is the only one that needs no decision from the user and loses nothing. If you agree I'll send it as a small follow-up with a test; if you prefer 1, nothing to do. |
Follow-up to #442, raised in its review.
The early
returnsat inadd_host()before the host is added to the inventory, so withskip_host_nics = Truethe whole host was dropped instead of just its physical interfaces. Verified with the vcsim suite: on currentdevelopmentthe option leaves zero hosts; with this change the hosts, their VMkernel interfaces and the VMs are synced and only the pNICs are skipped. The vswitch/port-group data is still collected because the VM interface parsing relies on it.Also adds the option to
settings-example.ini, which #442 did not, and documents that existing physical interfaces are no longer updated by the source once the option is on.Test:
tests/test_vmware_skip_host_nics.pyfails ondevelopment(no hosts) and passes here. Full suite green.