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
{{ message }}
Repository navigation
Commit d04b430
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CLAUDE.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,17 +39,17 @@ Auth: set `RUSTEZ_VSRX_KEY` for key-based or `RUSTEZ_VSRX_PASS` for password aut
39
39
-**ConfigPayload::Set** — maps to `LoadAction::Set, LoadFormat::Text`.
40
40
-**Namespace prefix** — `build_load_xml()` uses `nc:` prefix on XML elements to match rustnetconf 0.7.1's `<nc:rpc>` envelope. Required for Junos 24.4 compatibility.
41
41
-**Cluster auto-open** — `ConfigManager::load()` auto-calls `open_configuration(Private)` on clustered devices. `unlock()` auto-closes it. State tracked on `Device.config_db_open`.
42
-
-**Candidate-dirty tracking** — rustnetconf 0.14 only sends `<discard-changes/>` on close when *this* session dirtied the shared
42
+
-**Candidate-dirty tracking** — rustnetconf only sends `<discard-changes/>` on close when *this* session dirtied the shared
43
43
candidate. Typed ops (`load_configuration`, `rollback_configuration`, `edit_config`) mark it automatically; the raw `rpc()` /
44
-
`rpc_with_warnings()` path does not. **Prefer `RpcExecutor::call_xml_candidate_change()`** (Python:
45
-
`Device.rpc.raw_xml_candidate_change()`), which routes through `client.rpc_candidate_change()` and validates → preflights →
46
-
marks → sends atomically. Surfaced to callers as `Device::touched_candidate()`.
44
+
`rpc_with_warnings()` path does not. **Never hand-mark.** Use an atomic candidate-change call, which validates → preflights →
45
+
marks → sends as one step: `client.rpc_candidate_change()` (via `RpcExecutor::call_xml_candidate_change()`, Python
46
+
`Device.rpc.raw_xml_candidate_change()`), or `client.rpc_candidate_change_with_warnings()` when warnings are needed
47
+
(`ConfigManager::load_with_warnings()`). Surfaced to callers as `Device::touched_candidate()`.
47
48
-**A false dirty mark is worse than a missing one** — a missing mark leaves a dirty candidate that blocks the next lock; a false
48
-
mark makes `close()` discard *another operator's* uncommitted work, which is the bug this tracking exists to prevent. So if you
49
-
must hand-mark (only `load_with_warnings()` does, because there is no `rpc_candidate_change_with_warnings`), **validate the
50
-
fragment with `rustnetconf::rpc::validate_xml_fragment()` first, and validate before opening the config database** — the raw
51
-
`rpc*` calls reject a malformed fragment locally without sending, and `ConfigPayload::Xml` passes caller XML through unescaped.
52
-
Mark after validation but before the send, so a timeout or partial apply still counts.
49
+
mark makes `close()` discard *another operator's* uncommitted work, which is the bug this tracking exists to prevent. The raw
50
+
`rpc*` calls reject a malformed fragment locally *without sending*, and `ConfigPayload::Xml` passes caller XML through
51
+
unescaped, so hand-marking before one of them is a live way to reintroduce the bug. `mark_candidate_dirty()` exists but rustEZ
52
+
no longer calls it anywhere — the atomic calls above own the mark, and nothing should mark outside them.
53
53
-**Warnings** — `RpcExecutor::call_with_warnings()` / `call_xml_with_warnings()` return `(String, Vec<RpcErrorInfo>)`. `ConfigManager::load_with_warnings()` does the same for config loads.
0 commit comments