You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`HConfig` (root.py) — root node, owns the driver reference. Key methods: `config_to_get_to()`, `future()`, `difference()`, `dump_simple()`.
66
+
-`HConfig` (root.py) — root node, owns the driver reference. Key methods: `remediation()`, `future()`, `difference()`, `to_lines()`.
67
67
-`HConfigChild` (child.py) — tree node with `text`, `parent`, `children`, `tags`, `comments`. Provides `is_lineage_match()` for rule evaluation and `negate()` for negation logic.
68
-
-`HConfigBase` (base.py) — abstract base shared by both. Provides `add_child()`, `get_children_deep()`, `_config_to_get_to()` (left pass = negate missing, right pass = add new).
68
+
-`HConfigBase` (base.py) — abstract base shared by both. Provides `add_child()`, `get_children_deep()`, `_remediation()` (left pass = negate missing, right pass = add new).
69
69
-`HConfigChildren` (children.py) — ordered collection with O(1) dict lookup by text.
@@ -129,9 +129,9 @@ remediation = workflow.remediation_config # what to apply
129
129
rollback = workflow.rollback_config # how to revert
130
130
```
131
131
132
-
Internally it calls `running_config.config_to_get_to(generated_config)` which traverses the tree and calls `_config_to_get_to_left` (what to negate) and `_config_to_get_to_right` (what to add).
132
+
Internally it calls `running_config.remediation(generated_config)` which traverses the tree and calls `_remediation_left` (what to negate) and `_remediation_right` (what to add).
133
133
134
-
### `config_to_get_to()`
134
+
### `remediation()`
135
135
136
136
This method computes the **minimal delta** between two configs:
137
137
@@ -204,7 +204,7 @@ HConfig tree (HConfigBase / HConfigChild nodes)
Copy file name to clipboardExpand all lines: docs/future-config.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This feature is useful in scenarios where you need to determine the anticipated
7
7
- Verifying that a configuration change was successfully applied to a device
8
8
- For example, checking if the post-change configuration matches the predicted future configuration
9
9
- Generating a future-state configuration that can be analyzed by tools like Batfish to assess the potential impact of a change
10
-
- Building rollback configurations: once the future configuration state is known, a rollback configuration can be generated by simply creating the remediation in reverse `(rollback = future.config_to_get_to(running))`.
10
+
- Building rollback configurations: once the future configuration state is known, a rollback configuration can be generated by simply creating the remediation in reverse `(rollback = future.remediation(running))`.
11
11
- When building rollbacks for a series of configuration changes, you can use the future configuration from each change as input for the subsequent change. For example, use the future configuration after Change 1 as the input for determining the future configuration after Change 2, and so on.
12
12
13
13
## `merge()` versus `future()`
@@ -21,9 +21,9 @@ If you receive a `DuplicateChildError` while calling `merge()`, consider whether
Copy file name to clipboardExpand all lines: docs/glossary.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ A Python class that encodes all operating-system-specific behaviour for one netw
24
24
25
25
A configuration command where only the *last* value applied takes effect — applying the same command twice with different values results in only the second value being active. Typical examples: `hostname`, `ip address`, `description`.
26
26
27
-
hier_config uses `IdempotentCommandsRule` to identify these commands. During `config_to_get_to()`, when both the running and intended configs contain a command that matches an idempotency rule, the running value is **not** negated before the new value is applied (the new value simply overwrites it).
27
+
hier_config uses `IdempotentCommandsRule` to identify these commands. During `remediation()`, when both the running and intended configs contain a command that matches an idempotency rule, the running value is **not** negated before the new value is applied (the new value simply overwrites it).
28
28
29
29
**Example rule:**
30
30
@@ -126,7 +126,7 @@ A `SectionalExitingRule` that instructs hier_config to emit a closing token at t
126
126
127
127
## Sectional overwrite
128
128
129
-
A `SectionalOverwriteRule` that tells `config_to_get_to()` to **negate the entire section** and then re-create it from the intended config rather than performing a line-by-line diff. Appropriate for configuration blocks where the order of entries matters globally or where partial changes are not supported by the OS.
129
+
A `SectionalOverwriteRule` that tells `remediation()` to **negate the entire section** and then re-create it from the intended config rather than performing a line-by-line diff. Appropriate for configuration blocks where the order of entries matters globally or where partial changes are not supported by the OS.
0 commit comments