support netbox >=2.9 #177
No reviewers
Labels
No labels
help wanted
need testing
status: accepted
status: discussing
type: bug
type: documentation
type: duplicate
type: enhancement
type:hardware
type: invalid
type: major feature
type: minor feature
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: DGNum/netbox-agent#177
Loading…
Reference in a new issue
No description provided.
Delete branch "176-netbox-2.9"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #176
Still needs to fix tags for Inventory and custom tags
Thanks for addressing this issue. After upgrading to latest pynetbox, the update-inventory resulted in:
It seems that the IP must be removed from 'Primary IPv4' before removing from the interface.
Then I noticed the mask was wrong and changed it into '/24'. This time netbox_agent didn't try to delete the interface. It resulted in another error:
This VM already has 3 tags.
I'm yet to find a solution with the breaking changes for tags
For network, I'll try to reproduce the primary IP and handle this case
For tags I'm blocked by https://github.com/digitalocean/pynetbox/pull/307 or https://github.com/digitalocean/pynetbox/pull/291
Still trying to figure out something clean not depending on these 2 issues
Hello,
I have seen you mentioned my PR here. There is no way for you to make it work with 2.9 unless pynetbox is patched, because tags (and ip adresses interface assignment as well) has been changed.
Pre 2.9 tags was a list of tag names, and processed as a simple list by pynetbox. Updating this list with a new tag resulted in creating the tag if it did not exist.
Since 2.9 tags are objects like others, and you need to provide either the list of objects, or their ids, or a list of dicts with a least the "name" key (or a mix). Since pynetbox serialize inputs into json, it doesn't do it correctly. You can try to change your calls with the good format, pynetbox would send the wrong format anyway.
Regards
Seems like pynetbox merged the tags support 13 days ago. I'll go ahead and test this so I can do a proper release of netbox-agent
I've finally had the time to continue this PR.
It's working pretty well with my Netbox 2.10 install
I need to do more tests on, Netbox 2.11
I also think I'll remove all the if with versions <2.9 as this release of
netbox_agent
should only be compatible with newer Netbox versions@jbe-dw @ecoutinho if you're still using the agent, I'd be happy to get your feeback.
Hello,
I've posted here because you mentioned a discussion in pynetbox but i'm not using the agent.
Regards
Here's a short description of the changes we made on your branch after running the agent against a Netbox server in version
3.1.7
withpynetbox
in version6.1.2
:network
module to make it more readablesetup.py
now reads its requirements fromrequirements.txt
to avoid double maintenanceCurrently, we managed to run the agent successfully under Ubuntu
trusty
,xenial
andbionic
(focal
andCentOS 7
will follow soon, but I don't see why it would work differently).We've successfully tested this branch against Netbox
3.1.7
usingpynetbox
version6.1.2
. Perhaps there will some minor bugs to fix du to hardware specifics, but we think it's time to merge that work.