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

Improving error handling with conflicting SN and PN's #7

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

jasonyates
Copy link

If Netbox has multiple device types with the same Part Number the DeviceType.objects.get function throws an error. Same applies for devices with the same Serial Number. Neither condition should technically happen but Netbox doesn't treat PN or SN as unique so rather than throwing an exception, handle it gracefully.

If Netbox has multiple device types with the same Part Number the DeviceType.objects.get function throws an error. Same applies for devices with the same Serial Number. Neither condition should technically happen but Netbox doesn't treat PN or SN as unique so rather than throwing an exception, handle it gracefully.
@goebelmeier
Copy link
Owner

Are there any use cases for having different device types with the same part number?

@jasonyates
Copy link
Author

In our environment we had various deployment options for UCS-C220-M5 servers pre-configured. Depending on the use case we may deploy one with an addon VIC card for example. Rather than adding the interfaces after the fact, we had some pre-configured device types that have the same base part number.

When syncing the EOX data it errors on these situations. I'm unsure if our use case is a valid one so rather than doing something like iterating through all of the PN's and updating them the PR handles the error more gracefully so the sync can continue.

We also hit an issue where 2 devices had been incorrectly configured with the same SN. That was correct but I updated to include more graceful error handling there too.

@goebelmeier goebelmeier merged commit d027de4 into goebelmeier:main Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants