Skip to content

Commit

Permalink
fix: 🐛 Specify status for newly created Sites
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrew82 committed Jul 17, 2023
1 parent 6256a8b commit a3116df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nautobot_ssot/integrations/aci/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a3116df

Please sign in to comment.