Skip to content

Commit

Permalink
do not include tags in enabling/disabling device
Browse files Browse the repository at this point in the history
Signed-off-by: kimpaller <[email protected]>
  • Loading branch information
kimpaller committed Oct 23, 2024
1 parent eb08c5e commit c1162e9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nebula/netbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,15 +562,16 @@ def to_config(self, template): # noqa: C901
def enable(self, reason="nebula: Enable device"):
device_id = self.data["devices"]["id"]
author = self.nbi.get_user_from_token()
self.nbi.add_tag(device_id=device_id, tag="active")
self.nbi.update_status(device_id=device_id, status="active")
self.nbi.log_journal(device_id=device_id, author_id=author.id, comments=reason)

def disable(self, reason="nebula: Disable device"):
def disable(self, reason="nebula: Disable device", failed=False):
device_id = self.data["devices"]["id"]
author = self.nbi.get_user_from_token()
self.nbi.remove_tag(device_id=device_id, tag="active")
self.nbi.update_status(device_id=device_id, status="offline")
if failed:
self.nbi.update_status(device_id=device_id, status="failed")
else:
self.nbi.update_status(device_id=device_id, status="offline")
self.nbi.log_journal(device_id=device_id, author_id=author.id, comments=reason)


Expand Down

0 comments on commit c1162e9

Please sign in to comment.