diff options
author | John Estabrook <jestabro@vyos.io> | 2023-05-25 14:22:29 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-05-26 13:58:10 -0500 |
commit | 2ba5207ed96741c8b56edf23a66f966ea6b44c23 (patch) | |
tree | 884aa7a26f959a261d21c884edf838ef74ce91e8 /python/vyos/xml_ref/__init__.py | |
parent | d1c1598065b0406c4e46c13c71f56e5e555ce675 (diff) | |
download | vyos-1x-2ba5207ed96741c8b56edf23a66f966ea6b44c23.tar.gz vyos-1x-2ba5207ed96741c8b56edf23a66f966ea6b44c23.zip |
xml: T5242: add cli_defined boolean test for node existing under path
If non_local=False (default), cli_defined returns True if the node is a
child of the path in interface-definitions; otherwise True if node is a
descendent of the path.
Diffstat (limited to 'python/vyos/xml_ref/__init__.py')
-rw-r--r-- | python/vyos/xml_ref/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/python/vyos/xml_ref/__init__.py b/python/vyos/xml_ref/__init__.py index ae5184746..2e144ef10 100644 --- a/python/vyos/xml_ref/__init__.py +++ b/python/vyos/xml_ref/__init__.py @@ -45,6 +45,9 @@ def is_valueless(path: list) -> bool: def is_leaf(path: list) -> bool: return load_reference().is_leaf(path) +def cli_defined(path: list, node: str, non_local=False) -> bool: + return load_reference().cli_defined(path, node, non_local=non_local) + def component_version() -> dict: return load_reference().component_version() |