Skip to content

v4: Support duplicate children at root level #215

Description

@jtdub

Description

Currently HConfig._is_duplicate_child_allowed() returns False unconditionally (root.py:211-213). This means configs with repeated top-level sections (e.g., multiple ip prefix-list entries with the same name, FortiOS config blocks) either raise DuplicateChildError or silently merge.

Proposed Change

Make root-level duplicate handling driver-configurable, the same way ParentAllowsDuplicateChildRule works for HConfigChild. Either:

  • Add a root_allows_duplicate_child rule list to HConfigDriverRules
  • Or unify the mechanism so ParentAllowsDuplicateChildRule applies at root level too (with a root-matching sentinel in match_rules)

Breaking Change

Yes — changes the root HConfig class behavior and may affect downstream code that relies on the current deduplication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    v4-enhancementEnhancement planned for hier_config v4.0.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions