Conversation
Include vCenter tag category as name prefix (CategoryName:TagName). Also fix vm_exclude_by_tag_filter comparing strings to NBTag objects.
semx
reviewed
Sep 9, 2026
semx
left a comment
Collaborator
There was a problem hiding this comment.
Verified: merges onto development and the suite passes. Two things before I can take it. First, part of the change is not behind the flag: with tag_name_include_category off (the default), the tag description is now rewritten to "<category>: <description>" (or to the bare category name), and a Category.get() call is made for every tag. That changes what every existing user sees on the next run, so please keep both the description rewrite and the extra lookup under the option, so the default path stays byte-identical. Second, the PR targets main; please retarget it to development. The option itself looks good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vCenter tags have both a name and a category, but only the tag name was previously synced to NetBox. This loses context and makes it hard to distinguish tags that share a name across different categories.
Changes
Add new config option tag_name_include_category (bool, default False) in the VMware source config. When enabled, tags are synced to NetBox as CategoryName:TagName instead of just TagName.
The option is backward compatible — existing behaviour is preserved when False.
On first run after enabling, old bare-name tags are cleanly removed from objects and replaced with the prefixed format. Old orphaned tags in NetBox must be deleted manually as before.
Config example
tag_name_include_category = TrueNote:
if vm_exclude_by_tag_filter is in use and tag_name_include_category is enabled, filter entries must be updated to the CategoryName:TagName format.