Skip to content

Update netbox_api.py - Fix Error creating manufacturers (Only some of the manufacturers were imported.) #173

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

LHBL2003
Copy link

@LHBL2003 LHBL2003 commented May 8, 2025

Troubleshooting “Error creating manufacturers” Only a part of the data was imported. Cisco, Opengear, Fortinet e.g. not.

Thanks to chatgpt

Removes:
#172

Perhaps also:
#169

#123

📝 What has changed?
✅ Automatically generate slug using vendor.setdefault('slug', ...)
✅ Check for existing vendors by name or slug
✅ Improved log entries (now showing name and slug)
✅ Output includes how many vendors were newly created
✅ API error messages are displayed directly for better visibility

✅ Result:
With this function, no duplicate vendors will be created (whether matching by name or slug),
and if an error occurs, the exact API error message will be immediately visible.

Befor
image

After Change:
image

Troubleshooting “Error creating manufacturers” Only a part of the data was imported. Cisco, Opengear, Fortinet e.g. not.

Removes:
netbox-community#172

Perhaps also:
netbox-community#169

netbox-community#123
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.

1 participant