Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bootstrap Integration - Platforms won't import if no manufacturer assigned #612

Closed
bile0026 opened this issue Dec 5, 2024 · 0 comments · Fixed by #613
Closed

Bootstrap Integration - Platforms won't import if no manufacturer assigned #612

bile0026 opened this issue Dec 5, 2024 · 0 comments · Fixed by #613
Assignees
Labels
integration: bootstrap Issues/PRs for Bootstrap integration type: bug Issues/PRs addressing a bug.

Comments

@bile0026
Copy link
Contributor

bile0026 commented Dec 5, 2024

Environment

  • Python version: 3.11.4
  • Nautobot version: 2.3.12
  • nautobot-ssot version: 3.2.0

Expected Behavior

Platforms create when running the bootstrap integration

Observed Behavior

Key error occurs on loading data from Nautobot if there is no Manufacturer associated with a platform.

{
    "exc_message": [
        "'NoneType' object has no attribute 'name'"
    ],
    "exc_module": "builtins",
    "exc_type": "AttributeError"
}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/integrations/bootstrap/diffsync/adapters/nautobot.py", line 342, in load_platform
    self.get(self.platform, nb_platform.name)
  File "/usr/local/lib/python3.11/site-packages/diffsync/__init__.py", line 724, in get
    return self.store.get(model=obj, identifier=identifier)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/diffsync/store/local.py", line 49, in get
    raise ObjectNotFound(f"{modelname} {uid} not present in {str(self)}")
diffsync.exceptions.ObjectNotFound: platform linux not present in LocalStore

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 477, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 760, in __protected_call__
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 1136, in run_job
    result = job(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 149, in __call__
    return self.run(*args, **deserialized_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/integrations/bootstrap/jobs.py", line 105, in run
    super().run(dryrun=self.dryrun, memory_profiling=self.memory_profiling, *args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 354, in run
    self.sync_data(memory_profiling)
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 171, in sync_data
    self.load_target_adapter()
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/integrations/bootstrap/jobs.py", line 97, in load_target_adapter
    self.target_adapter.load()
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/integrations/bootstrap/diffsync/adapters/nautobot.py", line 1309, in load
    self.load_platform()
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/integrations/bootstrap/diffsync/adapters/nautobot.py", line 357, in load_platform
    manufacturer=nb_platform.manufacturer.name,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'name'

Steps to Reproduce

  1. Create a platform in Nautobot with no assigned Manufacturer attribute
  2. Run the Bootstrap Integration to sync platforms
@bile0026 bile0026 added type: bug Issues/PRs addressing a bug. integration: bootstrap Issues/PRs for Bootstrap integration labels Dec 5, 2024
@bile0026 bile0026 self-assigned this Dec 5, 2024
jdrew82 added a commit that referenced this issue Dec 5, 2024
fix: 🐛 fix issue #612 loading platforms with no manufacturer
@jdrew82 jdrew82 mentioned this issue Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration: bootstrap Issues/PRs for Bootstrap integration type: bug Issues/PRs addressing a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant