diff options
Diffstat (limited to 'os_net_config/impl_eni.py')
-rw-r--r-- | os_net_config/impl_eni.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/os_net_config/impl_eni.py b/os_net_config/impl_eni.py index 87d45da..5f4f727 100644 --- a/os_net_config/impl_eni.py +++ b/os_net_config/impl_eni.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- Coding: utf-8 -*- # Copyright 2014 Red Hat, Inc. # @@ -43,7 +43,7 @@ class ENINetConfig(os_net_config.NetConfig): self.interfaces = {} self.routes = {} self.bridges = {} - logger.info('Ifcfg net config provider created.') + logger.info('ENI net config provider created.') def _add_common(self, interface, static_addr=None): @@ -174,7 +174,10 @@ class ENINetConfig(os_net_config.NetConfig): logger.info('adding custom route for interface: %s' % interface_name) data = "" for route in routes: - rt = netaddr.IPNetwork(route.ip_netmask) + 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" % ( |