diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-07-25 21:42:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-25 21:42:46 +0200 |
commit | 50e671cd5a2c2143621d16a7249f8769b641fbd9 (patch) | |
tree | d337771dfe6a0264a44fb6eea263f5938ebfc137 /src/conf_mode | |
parent | ab5ca2796c1aad0043cc0db80299e4e2d42c1b22 (diff) | |
parent | 3945b2259aaa64eb9f4d61334126235f2d641293 (diff) | |
download | vyos-1x-50e671cd5a2c2143621d16a7249f8769b641fbd9.tar.gz vyos-1x-50e671cd5a2c2143621d16a7249f8769b641fbd9.zip |
Merge pull request #93 from DmitriyEshenko/patch-5
T1541 Fix: adding additional check
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/dhcpv6_relay.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/conf_mode/dhcpv6_relay.py b/src/conf_mode/dhcpv6_relay.py index 5868abe8a..ccabc901d 100755 --- a/src/conf_mode/dhcpv6_relay.py +++ b/src/conf_mode/dhcpv6_relay.py @@ -52,9 +52,10 @@ def get_config(): if conf.exists('listen-interface'): interfaces = conf.list_nodes('listen-interface') for intf in interfaces: - addr = conf.return_value('listen-interface {0} address'.format(intf)) - listen = addr + '%' + intf - relay['listen_addr'].append(listen) + if conf.exists('listen-interface {0} address'.format(intf)): + addr = conf.return_value('listen-interface {0} address'.format(intf)) + listen = addr + '%' + intf + relay['listen_addr'].append(listen) # Upstream interface/address for remote DHCPv6 server if conf.exists('upstream-interface'): @@ -82,7 +83,7 @@ def verify(relay): return None if len(relay['listen_addr']) == 0 or len(relay['upstream_addr']) == 0: - raise ConfigError('Must set at least one listen and upstream interface.') + raise ConfigError('Must set at least one listen and upstream interface addresses.') return None |