From ecc00da8c5e303af006052a00f904d187c90bb4b Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Fri, 4 Aug 2023 10:49:37 -0500 Subject: xml: T5435: utility function for default value at path --- python/vyos/xml_ref/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/vyos/xml_ref/__init__.py') diff --git a/python/vyos/xml_ref/__init__.py b/python/vyos/xml_ref/__init__.py index ad2130dca..9f7a31e2c 100644 --- a/python/vyos/xml_ref/__init__.py +++ b/python/vyos/xml_ref/__init__.py @@ -13,6 +13,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . +from typing import Optional, Union from vyos.xml_ref import definition def load_reference(cache=[]): @@ -54,6 +55,9 @@ def from_source(d: dict, path: list) -> bool: def component_version() -> dict: return load_reference().component_version() +def default_value(path: list) -> Optional[Union[str, list]]: + return load_reference().default_value(path) + def multi_to_list(rpath: list, conf: dict) -> dict: return load_reference().multi_to_list(rpath, conf) -- cgit v1.2.3