summaryrefslogtreecommitdiff
path: root/src/conf_mode/service_router-advert.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/service_router-advert.py')
-rwxr-xr-xsrc/conf_mode/service_router-advert.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/conf_mode/service_router-advert.py b/src/conf_mode/service_router-advert.py
index 65eb11ce3..9afcdd63e 100755
--- a/src/conf_mode/service_router-advert.py
+++ b/src/conf_mode/service_router-advert.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2018-2019 VyOS maintainers and contributors
+# Copyright (C) 2018-2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -40,11 +40,14 @@ def get_config(config=None):
# We have gathered the dict representation of the CLI, but there are default
# options which we need to update into the dictionary retrived.
default_interface_values = defaults(base + ['interface'])
- # we deal with prefix defaults later on
+ # we deal with prefix, route defaults later on
if 'prefix' in default_interface_values:
del default_interface_values['prefix']
+ if 'route' in default_interface_values:
+ del default_interface_values['route']
default_prefix_values = defaults(base + ['interface', 'prefix'])
+ default_route_values = defaults(base + ['interface', 'route'])
if 'interface' in rtradv:
for interface in rtradv['interface']:
@@ -56,6 +59,11 @@ def get_config(config=None):
rtradv['interface'][interface]['prefix'][prefix] = dict_merge(
default_prefix_values, rtradv['interface'][interface]['prefix'][prefix])
+ if 'route' in rtradv['interface'][interface]:
+ for route in rtradv['interface'][interface]['route']:
+ rtradv['interface'][interface]['route'][route] = dict_merge(
+ default_route_values, rtradv['interface'][interface]['route'][route])
+
if 'name_server' in rtradv['interface'][interface]:
# always use a list when dealing with nameservers - eases the template generation
if isinstance(rtradv['interface'][interface]['name_server'], str):