diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-10-03 11:47:14 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-10-03 11:47:14 +0200 |
commit | 2123eef951467ea2e69ec2ad3f68e0282f84414e (patch) | |
tree | 98e5faa08fb64a3d78c44275e4002d60cba9153e | |
parent | 7e8b1299e6e1ae68e1181d3ece29a68fe8b56f37 (diff) | |
download | vyos-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()
-rw-r--r-- | python/vyos/xml/definition.py | 2 |
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 |