From a3116dfb26efc6419fdef8a8966b3cbb77ee6282 Mon Sep 17 00:00:00 2001 From: Justin Drew <2396364+jdrew82@users.noreply.github.com> Date: Mon, 17 Jul 2023 12:10:33 -0500 Subject: [PATCH] fix: :bug: Specify status for newly created Sites --- nautobot_ssot/integrations/aci/signals.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nautobot_ssot/integrations/aci/signals.py b/nautobot_ssot/integrations/aci/signals.py index 152c3aa0..c9205094 100644 --- a/nautobot_ssot/integrations/aci/signals.py +++ b/nautobot_ssot/integrations/aci/signals.py @@ -59,12 +59,14 @@ def aci_create_site(apps, **kwargs): """Add site.""" site = apps.get_model("dcim", "Location") location_type = apps.get_model("dcim", "LocationType") + status = apps.get_model("extras", "Status") apics = PLUGIN_CFG.get("apics") loc_type = location_type.objects.update_or_create(name="Site")[0] + active_status = status.objects.update_or_create(name="Active")[0] for key in apics: if "SITE" in key: logger.info(f"Creating Site: {apics[key]}") - site.objects.update_or_create(name=apics[key], location_type=loc_type) + site.objects.update_or_create(name=apics[key], location_type=loc_type, status=active_status) def device_custom_fields(apps, **kwargs):