Skip to content

Commit

Permalink
ironic-to-nautobot: save provision_status as custom field
Browse files Browse the repository at this point in the history
  • Loading branch information
skrobul committed Jul 18, 2024
1 parent 50ad761 commit 7b5afe9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions argo-workflows/ironic-to-nautobot-sync/code/nautobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Nautobot:
'clean wait',
'available',
'deploying',
'wait call-back'
'wait call-back',
'deploy failed',
'active',
'deleting',
Expand Down Expand Up @@ -64,4 +64,7 @@ def update_status(self, device_id, new_status: str):
if new_status not in self.ALLOWED_STATUSES:
raise Exception(f"Status {new_status} for device {device_id} is not in ALLOWED_STATUSES.")

return device.update({"status": new_status})
device.custom_fields['ironic_provisioning_status'] = new_status
response = device.save()
print(f"save result: {response}")
return response

0 comments on commit 7b5afe9

Please sign in to comment.