diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-12-08 18:30:15 -0600 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-12-17 21:13:45 -0600 |
| commit | a6325f912bc66f1067d07964d81f86804533891f (patch) | |
| tree | 8e59f9626655c525f311a6d3dd7597df4df73b8f /src/reference_tree.ml | |
| parent | b63d13877a5b1f97391193c9857e8e20e0c6fa71 (diff) | |
| download | vyos1x-config-a6325f912bc66f1067d07964d81f86804533891f.tar.gz vyos1x-config-a6325f912bc66f1067d07964d81f86804533891f.zip | |
T8009: fix logic in test potential_tag_value
Diffstat (limited to 'src/reference_tree.ml')
| -rw-r--r-- | src/reference_tree.ml | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/reference_tree.ml b/src/reference_tree.ml index afde451..20f7829 100644 --- a/src/reference_tree.ml +++ b/src/reference_tree.ml @@ -649,12 +649,18 @@ let set_leaf_data rtree ctree path = let potential_tag_value rtree cpath = (* check given path against reftree for potential to be tag value *) + (* raises: + [Vytree.Nonexistent_path] from refpath; is_tag + *) match cpath with | [] | [_] -> false | _ -> + let refp = refpath rtree cpath in let ref_drop_last = refpath rtree (Util.drop_last cpath) in - if is_tag rtree ref_drop_last then true - else false + match ref_drop_last with + | [] -> false + | _ as c when c = refp -> is_tag rtree refp + | _ -> false (* The 'edit' command can descend along a not-as-yet configured path, assuming that it is |
