aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_eni.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_eni.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_eni.py')
-rw-r--r--os_net_config/impl_eni.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/os_net_config/impl_eni.py b/os_net_config/impl_eni.py
index ae60099..1d59b57 100644
--- a/os_net_config/impl_eni.py
+++ b/os_net_config/impl_eni.py
@@ -181,14 +181,17 @@ class ENINetConfig(os_net_config.NetConfig):
logger.info('adding custom route for interface: %s' % interface_name)
data = ""
for route in routes:
+ options = ""
+ if route.route_options:
+ options = " %s" % (route.route_options)
if route.default and not route.ip_netmask:
rt = netaddr.IPNetwork("0.0.0.0/0")
else:
rt = netaddr.IPNetwork(route.ip_netmask)
- data += "up route add -net %s netmask %s gw %s\n" % (
- str(rt.ip), str(rt.netmask), route.next_hop)
- data += "down route del -net %s netmask %s gw %s\n" % (
- str(rt.ip), str(rt.netmask), route.next_hop)
+ data += "up route add -net %s netmask %s gw %s%s\n" % (
+ str(rt.ip), str(rt.netmask), route.next_hop, options)
+ data += "down route del -net %s netmask %s gw %s%s\n" % (
+ str(rt.ip), str(rt.netmask), route.next_hop, options)
self.routes[interface_name] = data
logger.debug('route data: %s' % self.routes[interface_name])