-
Notifications
You must be signed in to change notification settings - Fork 242
Fix netbox_inventory service query #1438
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: devel
Are you sure you want to change the base?
Conversation
@sc68cal I'm currently struggling really seeing through the inventory tests. One thing missing for the fix itself is backwards compat. 4.3 introduced the break. 4.2 and 4.1 won't work with my code. Would be cool if you show me a piece of code where you usually handle that kinda stuff. My commits also re-enable and fix the DeepDiff on the inventory tests. There's HUGE discrepancies apparently |
@StoffelCPR , if self.endpoint == "services" and self._version_check_greater(
self.version, "4.3", greater_or_equal=True
):
if "device" in data:
data["parent_object_type"] = "dcim.device"
data["parent_object_id"] = data["device"]
del data["device"]
elif "virtual_machine" in data:
data["parent_object_type"] = "virtualization.virtualmachine"
data["parent_object_id"] = data["virtual_machine"]
del data["virtual_machine"] |
Alrighty. Thanks @benoit-ferre You can search in the integration testing jobs under inventory tests if you search for I have the same active for populating the dictionaries. The famous sentence: It works on my machine. I've re-enabled the inventory tests in this PR, they now properly work and display the diff to the console again. I believe the inventory tests are degraded and broken since I can't really see the differences expected here. Maybe you can give some input whether to fix this here or open another Issue trying to narrow down what's missing and maybe suggesting fixed (maybe even fix them myself depending on time available) |
Related Issue
#1430
New Behavior
This is a first iteration of a possible fix for the service integration to post 4.3 Netbox versions.
...
Contrast to Current Behavior
Services remain empty as Netbox has introduced breaking changes
...
Discussion: Benefits and Drawbacks
Benefit:
re-established function to fetching services
Drawback:
Dumb quick fix. I'd need some help properly onboarding my changes into your change management
...
Changes to the Documentation
Probably no
...
Proposed Release Note Entry
Fixed service mapping to new Netbox parent object structure
...
Double Check
devel
branch.