Skip to content

Commit

Permalink
fixes removal of orphan status for IP address of offline VMs bb-Ricar…
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-Ricardo authored and kuznetsov andrei committed Feb 27, 2023
1 parent 6df271c commit d542e72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions module/netbox/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ def tag_all_the_things(self, netbox_handler):
grab(device_vm_object, "data.status") is not None and \
"active" not in str(grab(device_vm_object, "data.status")):

if netbox_handler.orphaned_tag in this_object.get_tags():
this_object.remove_tags(netbox_handler.orphaned_tag)

log.debug2(f"{device_vm_object.name} '{device_vm_object.get_display_name()}' has IP "
f"'{this_object.get_display_name()}' assigned but is in status "
f"{grab(device_vm_object, 'data.status')}. "
Expand Down

0 comments on commit d542e72

Please sign in to comment.