-
Notifications
You must be signed in to change notification settings - Fork 69
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
Netbox sync does not remove tags from object #359
Comments
Hi @Daviran, Thank you very much. Very good point. This is not implemented due to following reasons: What do you think? |
Hi, Of course, deletion should occur only when tag has 0 associated resources, even if the setting is True. With your explanation you already have the comment for the setting 🤣 |
Hi @rizlas, This is a great idea. I added pruning for unused tags in the Thank you. |
On it during this week |
Hi, With this description:
When vCenterA sync starts, "storage" tag description will be: "NetBox-synced vCenterA: " When vCenterB sync starts, "storage" tag description will be: "NetBox-synced vCenterB: " I think we can find a solution to handle multiple |
I forgot the main thing!
This is still happening. Tag was not removed from VirtualMachine object. |
Good point, currently tags are not compared backwards, will look into it. |
good point as well, we should just remove the source name and only state that these tags are handled by netbox-sync. What do you think? |
Yeah, seems reasonable enough. |
Hi @rizlas, I fixed the issue with the tag description and that it was not remove. Can you check if it works properly now. Also the tag might only be removed on the second run:
The script is querying the associations, but this only at the beginning. At the beginning of the first run the tag still has assigned objects, on the second run the counter should be If this all works then feel free to close this issue. Thank you very much again for your support |
Hi, eg: VM
Step six is not happening. Also, consider this to avoid semicolon when description is empty:
|
Hi @rizlas, Thank you for bearing with me and this detailed explanation. I finally got around to look into this again and I believe I found the issue. I just pushed another commit to Can you please test it and let me know if it works now. Feel free to close the issue if your tests were successful. Thank you. |
Hi, Unfortunately tags are not yet deleted. Do I need to check any logs in particular? |
Hi, so you checked out the latest the logs should mention the removal of a tag when parsing the object during the sync. b7388d9#diff-e7a495959928cbb6f10cb4c5343bbcae7a58acda168716b8db7690442f8e8a7eR1108-R1118 Here you could add debug lines like these to see which tags are found and which tags are currently assigned: print(new_object_tags)
print(device_vm_object.data.get("tags", list())) |
Sorry, rush answer. |
Hi @rizlas, thank you for testing. I just tested it and it seems to work in my setup. I created a new Tag with
Can you please have another look? Does your tag description differ? Thank you |
{
"id": 416,
"url": "https://netbox/api/extras/tags/416/",
"display": "test_netbox_sync",
"name": "test_netbox_sync",
"slug": "test_netbox_sync",
"color": "9e9e9e",
"description": "NetBox-synced: This is a nice test",
"object_types": [],
"tagged_items": 1,
"created": "2024-02-16T09:47:07.835749Z",
"last_updated": "2024-02-16T09:47:07.835765Z"
} Yeah it's working. Dunno why yesterday wasn't. Good, I had a look to deletion process, is really simple. Well done. I'm not the author of the issue, so I can't close it. Thank you! |
great, thank you for testing it again. Then I can finally release the next version |
On it immediately 🤣 |
Yes 😬, Was just waiting for your positive feedback. Now we got some neat bug fixes and great new features. Thanks again for your great help here. Now I need to tackle the next 🐞. |
You've missed to build docker image I guess 😄 |
FFFFUUUUUUU***** And just realised that the docker build is broken. thank you. will take care of it. |
You sure? I've build it manually from main branch. All fine. |
So, now the image should be uptodate. Had a local issue with my docker setup. All fixed now. |
Hello @bb-Ricardo , amazing job with your script it saved me a lot of time at work.
I wonder if the script removes the tags from Netbox after it was deleted on Vcenter.
I've tried to : create a custom tag on V-center, applied it to a VM, then run the netbox-sync. It works like a charm.
However, if I erase the tag in V-center from the VM, when I run back netbox-sync the tag is not removed in Netbox.
If you have already implemented this feature, can you point the direction?
Again, thanks with your amazing work
The text was updated successfully, but these errors were encountered: