netbox-community / pynetbox

Python API client library for Netbox.
Apache License 2.0
580 stars 172 forks source link

Fix API version for Netbox version > 4.x #616

Closed btriller closed 5 months ago

btriller commented 6 months ago

fixes #612

terraflubb commented 5 months ago

I think this is a nicer solution to #612 than mine as it captures more potential failure cases (#613 won't solve the "I don't have auth, just curious what version, which isn't a secret anyway"), plus it's smaller. But I'll take whatever I can get at this point.

But FYI @btriller , the workflow that does the linting (which requires approval and who knows when that will happen :cry:) will fail as I discovered. It looks like this check was added without first being executed on the code base.

If you cherry-pick this commit from my PR: https://github.com/netbox-community/pynetbox/pull/613/commits/603601696e06237898b5f6d6f49ba5d8737a5862

It will add all the newlines needed to pass the linting.

Speaking from experience, it would be disappointing if this finally got its workflow approved only to be stalled by another month for reasons outside your control.

terraflubb commented 5 months ago

:heart: Thank you so much for jumping in @jeffgdotorg !