From 2123eef951467ea2e69ec2ad3f68e0282f84414e Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 3 Oct 2020 11:47:14 +0200 Subject: vyos.xml: T2956: add support for list of defaultValues Sometimes (PPPoE server is one of them) a simple defaultValue in the XML is not enough - several values should be set. In order to support a list of defaultValues you can now simply list them as a whitespace separated string. Example: pap chap mschap mschap-v2 will generate a Python list ['pap', 'chap', 'mschap', 'mschap-v2'] when retrieved by vyos.xml.defaults() --- python/vyos/xml/definition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/vyos/xml/definition.py b/python/vyos/xml/definition.py index a25fc50c5..7831af4d2 100644 --- a/python/vyos/xml/definition.py +++ b/python/vyos/xml/definition.py @@ -297,7 +297,7 @@ class XML(dict): continue value = conf[k] if self.is_multi(fpath) and not isinstance(value, list): - value = [value] + value = value.split(' ') r[under] = value return r -- cgit v1.2.3