diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-07-16 20:33:45 -0500 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-07-17 11:49:52 -0500 |
| commit | 59c22fbdc1f1a9ad277c5ed8c9665ce0f8d86e57 (patch) | |
| tree | 47e6aba2a8a6f73d6d2966e99e77b16eae0ea3f4 /src/commit.ml | |
| parent | 011ea89145daf67b639053cedb62c01f682038ab (diff) | |
| download | vyconf-59c22fbdc1f1a9ad277c5ed8c9665ce0f8d86e57.tar.gz vyconf-59c22fbdc1f1a9ad277c5ed8c9665ce0f8d86e57.zip | |
T7637: fix typo in update of trees when cloning path with tag_value
This missed a proper update in the case of failures in a collection of
tag node values; caught in test_interfaces_vxlan.py test_vxlan_external.
Diffstat (limited to 'src/commit.ml')
| -rw-r--r-- | src/commit.ml | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/commit.ml b/src/commit.ml index 0d675d8..2e2dbac 100644 --- a/src/commit.ml +++ b/src/commit.ml @@ -181,7 +181,12 @@ let config_result_update c_data n_data = match r.success, n_data.source with | true, ADD -> let add = CT.get_subtree c_data.config_diff ["add"] in - let add_tree = CD.clone add (CT.default) n_data.path in + let path = + match n_data.tag_value with + | None -> n_data.path + | Some v -> n_data.path @ [v] + in + let add_tree = CD.clone add (CT.default) path in let config = CD.tree_union add_tree c_data.config_result in let result = { success = c_data.result.success && true; @@ -190,7 +195,12 @@ let config_result_update c_data n_data = { c_data with config_result = config; result = result; } | false, DELETE -> let del = CT.get_subtree c_data.config_diff ["del"] in - let add_tree = CD.clone del (CT.default) n_data.path in + let path = + match n_data.tag_value with + | None -> n_data.path + | Some v -> n_data.path @ [v] + in + let add_tree = CD.clone del (CT.default) path in let config = CD.tree_union add_tree c_data.config_result in let result = { success = c_data.result.success && false; |
