diff options
author | Daniil Baturin <daniil@baturin.org> | 2018-08-26 18:15:30 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2018-08-26 18:15:30 +0200 |
commit | ffc8d1f4666874bd2641be54fc16515daf065985 (patch) | |
tree | 6ec6532d54e9138ea62631dc3e906a5c80a5c364 | |
parent | 3acb6381bc2a56e70a58b3a19ae817473f8dd5f4 (diff) | |
download | vyos-1x-ffc8d1f4666874bd2641be54fc16515daf065985.tar.gz vyos-1x-ffc8d1f4666874bd2641be54fc16515daf065985.zip |
T801: correct parsing of returnValues and listNodes output.
-rw-r--r-- | python/vyos/config.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py index 5af830480..bcf04225b 100644 --- a/python/vyos/config.py +++ b/python/vyos/config.py @@ -280,8 +280,8 @@ class Config(object): else: try: out = self._run(self._make_command('returnValues', full_path)) - values = out.split() - return list(map(lambda x: re.sub(r'^\'(.*)\'$', r'\1',x), values)) + values = re.findall(r"\'(.*?)\'", out) + return values except VyOSError: return(default) @@ -309,8 +309,8 @@ class Config(object): if self.is_tag(path): try: out = self._run(self._make_command('listNodes', full_path)) - values = out.split() - return list(map(lambda x: re.sub(r'^\'(.*)\'$', r'\1',x), values)) + values = re.findall(r"\'(.*?)\'", out) + return values except VyOSError: return(default) else: |