Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ACI sync fails if LocationType is not "site" #597

Closed
kingfetty opened this issue Nov 11, 2024 · 3 comments · Fixed by #653
Closed

ACI sync fails if LocationType is not "site" #597

kingfetty opened this issue Nov 11, 2024 · 3 comments · Fixed by #653
Labels
integration: ciscoaci Issues/PRs for Cisco ACI integration. type: bug Issues/PRs addressing a bug.

Comments

@kingfetty
Copy link
Contributor

Environment

  • Python version: 3.11
  • Nautobot version: 2.3.8
  • nautobot-ssot version: 3.2.0

Expected Behavior

SSOT [ACI] should sync regardless of location type. Not all implementations will use "site" location type.

Observed Behavior

Attempting to sync aci data if location type "site" does not exist results in failure

Steps to Reproduce

  1. Configure SSOT [ ACI ] Plugin
  2. Setup location types with no location type called "site"
  3. Attempt to sync data.
@jdrew82 jdrew82 added the integration: ciscoaci Issues/PRs for Cisco ACI integration. label Nov 20, 2024
@jdrew82
Copy link
Contributor

jdrew82 commented Dec 13, 2024

@kingfetty Have you tested 3.3.0? I don't think this is an issue any longer.

@kingfetty
Copy link
Contributor Author

@jdrew82 Yes this is still an issue in 3.3.0 and have tested as such.

Attempting to sync ACI without a LocationType named "Site" produces the following Job resutl:

{
    "exc_message": [
        "Location matching query does not exist."
    ],
    "exc_module": "nautobot.dcim.models.locations",
    "exc_type": "Location.DoesNotExist"
}

If you examine the source code in the ACI diffsync model:
https://github.com/nautobot/nautobot-app-ssot/blob/develop/nautobot_ssot/integrations/aci/diffsync/models/nautobot.py

You will see the create, update, and delete functions all rely on querying the location by specifying the LocationType must be "Site"

Create:
location=Location.objects.get(name=ids["site"], location_type=LocationType.objects.get(name="Site"))

Update/Delete:
location=Location.objects.get(name=self.site, location_type=LocationType.objects.get(name="Site")),

@jdrew82 jdrew82 added the type: bug Issues/PRs addressing a bug. label Jan 14, 2025
@jdrew82
Copy link
Contributor

jdrew82 commented Jan 14, 2025

@kingfetty I see it now. Apologies for missing this before. I've gone ahead and got a fix coming shortly.

@jdrew82 jdrew82 linked a pull request Jan 14, 2025 that will close this issue
2 tasks
@jdrew82 jdrew82 mentioned this issue Jan 14, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
integration: ciscoaci Issues/PRs for Cisco ACI integration. type: bug Issues/PRs addressing a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants