Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

---

## [3.6.0] - 2026-03-26

### Added

- `TextStyle` type alias (`Literal["without_comments", "merged", "with_comments"]`) for
Expand All @@ -27,6 +31,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
to `^\s*!\s*$` so bare `!` lines at any indentation level are stripped, restoring
v3.4.2 behavior (#231).

- `__hash__` and `__eq__` inconsistency in `HConfigChild`: `__hash__` included
`new_in_config` and `order_weight` but `__eq__` excluded them, and `__eq__` checked
`tags` but `__hash__` did not, violating the Python invariant that `a == b` implies
`hash(a) == hash(b)`. Both methods now use the same fields: `text`, `tags`, and
`children` (#185).

---

## [3.5.0] - 2026-03-19
Expand Down Expand Up @@ -226,7 +236,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

[Unreleased]: https://github.com/netdevops/hier_config/compare/v3.4.1...HEAD
[Unreleased]: https://github.com/netdevops/hier_config/compare/v3.6.0...HEAD
[3.6.0]: https://github.com/netdevops/hier_config/compare/v3.5.1...v3.6.0
[3.5.1]: https://github.com/netdevops/hier_config/compare/v3.5.0...v3.5.1
[3.5.0]: https://github.com/netdevops/hier_config/compare/v3.4.3...v3.5.0
[3.4.3]: https://github.com/netdevops/hier_config/compare/v3.4.2...v3.4.3
[3.4.2]: https://github.com/netdevops/hier_config/compare/v3.4.1...v3.4.2
[3.4.1]: https://github.com/netdevops/hier_config/compare/v3.4.0...v3.4.1
[3.4.0]: https://github.com/netdevops/hier_config/compare/v3.3.0...v3.4.0
[3.3.0]: https://github.com/netdevops/hier_config/compare/v3.2.2...v3.3.0
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Hierarchical Configuration has been used extensively on:
- [x] Fortinet FortiOS
- [x] HP Procurve (Aruba AOSS)
- [x] HP Comware5 / H3C
- [x] Huawei VRP

In addition to the Cisco-style syntax, hier_config offers experimental support for Juniper-style configurations using set and delete commands. This allows users to remediate Junos configurations in native syntax. However, please note that Juniper syntax support is still in an experimental phase and has not been tested extensively. Use with caution in production environments.

Expand Down
2 changes: 2 additions & 0 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Auto-generated reference documentation for the `hier_config` public API.

::: hier_config.models.Platform

::: hier_config.models.TextStyle

::: hier_config.models.MatchRule

::: hier_config.models.TagRule
Expand Down
35 changes: 34 additions & 1 deletion docs/drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ The following drivers are included in Hier Config:
- **CISCO_IOS**
- **CISCO_XR**
- **CISCO_NXOS**
- **GENERIC**
- **FORTINET_FORTIOS**
- **GENERIC**
- **HP_COMWARE5**
- **HP_PROCURVE**
- **HUAWEI_VRP**
- **JUNIPER_JUNOS**
- **VYOS**

Expand Down Expand Up @@ -244,6 +245,38 @@ for line in workflow.remediation_config.all_children_sorted():

---

### Huawei VRP Driver

Huawei VRP (Versatile Routing Platform) uses `undo` as the negation prefix rather than `no`. The `HUAWEI_VRP` driver customises negation handling for several command families:

- **[Negation prefix](glossary.md#negation-prefix)**: `undo ` (replaces `no `).
- **Smart negation**: `description` and `alias` commands are negated without their argument; `remark` commands strip the remark text; `snmp-agent community` commands truncate to the community name.
- **Sectional exiting**: section exit text `exit` is translated to `quit` as VRP requires.
- **Per-line substitutions**: strips `#` and `!` comment lines during parsing.

Platform enum: `Platform.HUAWEI_VRP`

```python
from hier_config import Platform, get_hconfig_driver

driver = get_hconfig_driver(Platform.HUAWEI_VRP)
```

**Remediation example:**

```python
from hier_config import WorkflowRemediation, get_hconfig, Platform

running = get_hconfig(Platform.HUAWEI_VRP, running_text)
intended = get_hconfig(Platform.HUAWEI_VRP, intended_text)
workflow = WorkflowRemediation(running, intended)

for line in workflow.remediation_config.all_children_sorted():
print(line.cisco_style_text())
```

---

### Fortinet FortiOS Driver

Fortinet firewalls model their CLI around `config` and `edit` blocks that are
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hier-config"
version = "3.5.1"
version = "3.6.0"
description = "A network configuration query and comparison library, used to build remediation configurations."
packages = [
{ include="hier_config", from="."},
Expand Down
Loading