Page MenuHomeVyOS Platform

vyos-1x config parser does not support reading string with spaces
Closed, ResolvedPublicBUG

Description

Imagine the following configuration:

service {
     dhcp-server {
         shared-network-name VLAN202 {
             authoritative enable
             description foobar
             subnet 172.16.34.8/29 {
                 default-router 172.16.34.14
                 dns-server 172.16.254.32
                 dns-server 172.16.254.31
                 domain-name vyos.net
                 lease 300
                 ntp-server 172.16.100.10
                 ntp-server 172.16.100.20
                 start 172.16.34.10 {
                     stop 172.16.34.14
                 }
                 static-mapping STATIC-01 {
                     ip-address 172.16.34.12
                     mac-address 01:02:03:04:05:06
                     static-mapping-parameters "ddns-hostname name;"
                     static-mapping-parameters "ddns-test-hostname name;"
                 }
             }
         }
     }
}

Using the new vyos-1x parser results in

tmp = conf.return_values('service dhcp-server shared-network-name VLAN202 subnet 172.16.34.8/29 static-mapping STATIC-01 static-mapping-parameters')
print(tmp)
> ["ddns-hostname","name;","ddns-test-hostname","name"]

But the expected result should be a list with two elements ["ddns-hostname name;","ddns-test-hostname name"] instead of four.

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.2.0-rolling+201808200949
Why the issue appeared?
Will be filled on close