From 3977fe705b0155ef380e3522201b812fa2149f76 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Sat, 27 Jun 2020 13:47:52 +0100 Subject: xml: T2656: option to not flatten the default dict --- python/vyos/xml/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'python/vyos/xml/__init__.py') diff --git a/python/vyos/xml/__init__.py b/python/vyos/xml/__init__.py index 52f5bfb38..bda8c96c5 100644 --- a/python/vyos/xml/__init__.py +++ b/python/vyos/xml/__init__.py @@ -35,5 +35,10 @@ def load_configuration(cache=[]): return xml -def defaults(lpath): - return load_configuration().defaults(lpath) +def defaults(lpath, flat=True): + return load_configuration().defaults(lpath, flat) + + +if __name__ == '__main__': + print(defaults(['service'], flat=True)) + print(defaults(['service'], flat=False)) -- cgit v1.2.3