summaryrefslogtreecommitdiff
path: root/python/vyos/xml
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-10-03 11:47:14 +0200
committerChristian Poessinger <christian@poessinger.com>2020-10-03 11:47:14 +0200
commit2123eef951467ea2e69ec2ad3f68e0282f84414e (patch)
tree98e5faa08fb64a3d78c44275e4002d60cba9153e /python/vyos/xml
parent7e8b1299e6e1ae68e1181d3ece29a68fe8b56f37 (diff)
downloadvyos-1x-2123eef951467ea2e69ec2ad3f68e0282f84414e.tar.gz
vyos-1x-2123eef951467ea2e69ec2ad3f68e0282f84414e.zip
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: <defaultValue>pap chap mschap mschap-v2</defaultValue> will generate a Python list ['pap', 'chap', 'mschap', 'mschap-v2'] when retrieved by vyos.xml.defaults()
Diffstat (limited to 'python/vyos/xml')
-rw-r--r--python/vyos/xml/definition.py2
1 files changed, 1 insertions, 1 deletions
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