-
Notifications
You must be signed in to change notification settings - Fork 5.6k
accept either ["site"] or ["scope"] for duplicate site entry detection due to netbox API change #68453
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
base: 3006.x
Are you sure you want to change the base?
accept either ["site"] or ["scope"] for duplicate site entry detection due to netbox API change #68453
Conversation
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey. There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
CHANGELOG.md
Outdated
| ## [Unreleased] | ||
|
|
||
| ### Fixed | ||
|
|
||
| - Fixed issue with upstream Netbox API changing api/ipam/prefixes output to | ||
| use "scope" FK instead of "site" [#68375](https://github.com/saltstack/salt/issues/68375) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not edited manually to add change logs. See https://docs.saltproject.io/en/master/topics/development/contributing.html#changelog-and-commit for steps on adding a change log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted + changed.
salt/pillar/netbox.py
Outdated
| prefix_count = 0 | ||
| for prefix in site_prefixes_results: | ||
| del site_prefixes_results[prefix_count]["site"] | ||
| if "site" in site_prefixes_results[prefix_count].keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For checking if an item is in a dictionary you just call in against the dictionary reference itself--you don't call in on .keys(): if "site" in site_prefixes_results[prefix_count]:. However you may just want to try to delete both:
site_prefixes_results[prefix_count].pop("site", None)
site_prefixes_results[prefix_count].pop("scope", None)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted + changed.
|
Netbox has been removed from salt starting with the 3008 release. It is recommended that all bug fixes go into the netbox salt extension. |
…n due to netbox API change
796da2d to
7f07a7b
Compare
yes, it's was removed in commit dc526dc, i.e. already not present in 3007.x. This commit is against 3006.x. There's nothing in the saltext-netbox repo yet. If/when it appears there, I'll make sure it's ported over there. |
What does this PR do?
The netbox API changed format in netbox 4.2.0 to change to a generic foreign key format. This commit allows both old and new API formats.
What issues does this PR fix or reference?
Fixes #68375
Previous Behavior
the minion pillar data failed to load with:
New Behavior
minion pillar now loads
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
No