aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_ifcfg.py
diff options
context:
space:
mode:
authorMatthew Flusche <mflusche@redhat.com>2016-10-19 18:10:08 +0000
committerMatthew Flusche <mflusche@redhat.com>2016-10-19 22:19:17 +0000
commit4fdb0a6a2b355750ae8071e53a74b9257b18eeee (patch)
tree44ea7032fa922ec7dc4181b5512901da5917a99b /os_net_config/impl_ifcfg.py
parent191a3b042cf303d70df5badefe9defe81ae4bd6d (diff)
Add route_options parameter
route_options will append additional options to route definitions. Change-Id: I2b70efdd9c6df7ea252576e245fbc0e9c46ea4bd
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r--os_net_config/impl_ifcfg.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index 56f2b33..4a4caaa 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -313,24 +313,29 @@ class IfcfgNetConfig(os_net_config.NetConfig):
data6 = ""
first_line6 = ""
for route in routes:
+ options = ""
+ if route.route_options:
+ options = " %s" % (route.route_options)
if ":" not in route.next_hop:
# Route is an IPv4 route
if route.default:
- first_line = "default via %s dev %s\n" % (route.next_hop,
- interface_name)
+ first_line = "default via %s dev %s%s\n" % (
+ route.next_hop, interface_name,
+ options)
else:
- data += "%s via %s dev %s\n" % (route.ip_netmask,
- route.next_hop,
- interface_name)
+ data += "%s via %s dev %s%s\n" % (
+ route.ip_netmask, route.next_hop,
+ interface_name, options)
else:
# Route is an IPv6 route
if route.default:
- first_line6 = "default via %s dev %s\n" % (route.next_hop,
- interface_name)
+ first_line6 = "default via %s dev %s%s\n" % (
+ route.next_hop, interface_name,
+ options)
else:
- data6 += "%s via %s dev %s\n" % (route.ip_netmask,
- route.next_hop,
- interface_name)
+ data6 += "%s via %s dev %s%s\n" % (
+ route.ip_netmask, route.next_hop,
+ interface_name, options)
self.route_data[interface_name] = first_line + data
self.route6_data[interface_name] = first_line6 + data6
logger.debug('route data: %s' % self.route_data[interface_name])