Fix: Show neutral indicator for inherited sync status#114
Open
berlikm wants to merge 6 commits into
Open
Conversation
This was referenced Jul 13, 2026
berlikm
force-pushed
the
fix/inherited-sync-status
branch
2 times, most recently
from
July 14, 2026 13:24
e78a327 to
1fe972b
Compare
Adds Site, SiteGroup, and Region as valid assignment targets for all ZabbixServerAssignment, ZabbixHostgroupAssignment, ZabbixTemplateAssignment, ZabbixTagAssignment, ZabbixMacroAssignment, and ZabbixHostInventory objects. This allows assignments made at the Site/SiteGroup/Region level to be inherited by all devices and VMs at that site or below, via the existing inheritance_chain mechanism. Changes: - Constants: Site/SiteGroup/Region added to ASSIGNMENT_MODELS, ASSIGNMENT_TYPE_TO_FIELD, PATH_LABELS - Forms: All 7 assignment forms get Site/SiteGroup/Region DynamicModelChoiceField + FieldSet - Settings: inheritance_chain extended with Site/SiteGroup/Region resolution paths - Jobs: SyncHostJob._prepare_assignment() creates detached copies for inherited assignments - HostSync: _get_sync_target() resolves actual Device/VM for Jinja2 rendering - HostSync: get_tag_attributes() deduplicates tags by (tag, value) to prevent Zabbix 7 rejecting duplicate pairs inherited from multiple sources - HostInterfaceSync: get_create_params() falls back to the device's primary IP when the interface has no IP assigned (e.g. when inherited from SiteGroup) - HostInterfaceSync: errors are caught per-interface so one failing interface does not prevent the remaining interfaces and templates from being synced - Inheritance: ConfigGroup interface expansion removed; interfaces are now resolved naturally via the inheritance chain with primary IP fallback - SyncBase: _is_inherited_copy guard prevents save()/update_sync_info() on inherited copies - Views: ZabbixSiteTabView, ZabbixSiteGroupTabView, ZabbixRegionTabView added - Tests: 9 new tests for inheritance resolution Tested: all 1076 existing tests pass. Verified end-to-end on dev NetBox.
- Filter inherited/direct ZabbixServerAssignment and ZabbixHostInterface by zabbixserver - Resolve ConfigGroup interface IP from primary_ip4/primary_ip6 - Add seen-set cycle guard to resolve_path
- Fixes silent dropping of Site/SiteGroup assignments
berlikm
force-pushed
the
fix/inherited-sync-status
branch
from
July 14, 2026 14:34
1fe972b to
48326cb
Compare
Fixes inherited Site/SiteGroup/Region assignments reading custom fields from the intermediate object instead of the actual Device/VM.
Inherited ZabbixServerAssignment rows (from Site, SiteGroup, Platform, etc.)
always show a red X ('Never synced') because update_sync_info() is correctly
skipped for inherited copies. This is misleading — the host may have been
successfully synced.
Adds InheritedSyncStatusColumn which checks the _inherited_from attribute
(set during inheritance resolution) and shows a neutral grey sync icon
with tooltip 'Inherited assignment (Site). Sync this host using the
Zabbix sync action.' instead of the red X.
This follows the same pattern as InheritanceAwareActionsColumn which
already hides edit/delete buttons for inherited rows.
The accessor is set to tables.A('pk') because django-tables2 skips
rendering when the accessor resolves to None (inherited copies may
have pk=None in some contexts).
Tested: all 1092 existing tests pass.
berlikm
force-pushed
the
fix/inherited-sync-status
branch
from
July 14, 2026 15:01
48326cb to
53e0aeb
Compare
Author
|
This PR is part of the zero-touch provisioning feature set described in #121. Please see that issue for the full architecture and motivation. |
berlikm
added a commit
to berlikm/nbxsync
that referenced
this pull request
Jul 15, 2026
# Conflicts: # nbxsync/tables/zabbixserverassignment.py
berlikm
force-pushed
the
fix/inherited-sync-status
branch
from
July 16, 2026 07:33
7f32c66 to
53e0aeb
Compare
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.
Summary
Shows a neutral grey indicator for inherited assignments in the Zabbix tab, instead of the misleading red X 'Never synced'. Inherited assignments are read-only copies — their sync status is not persisted by design.
Changes
InheritedSyncStatusColumn— checks_inherited_fromattribute. If set, renders a neutral 'sync' icon. Otherwise falls back to the normal success/failure indicators.ZabbixServerAssignmentTable(list view) andZabbixServerAssignmentObjectViewTable(device/VM tab).Dependencies
Stacks on PR #115. Merge after #115.
Testing
All existing tests pass. Verified on dev NetBox — inherited assignments show grey indicator, direct assignments show green/red.
Part of #121.