Skip to content
Snippets Groups Projects
Commit 8867ff1b authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Fixed defroute handling

parent c6d8dc3c
Branches
No related tags found
No related merge requests found
/hostinfo
*.pyc
*~
......@@ -89,6 +89,9 @@ def generate_ifcfgv4(tree, interface, search, nameservers):
pass
index = int('0%s' % index)+1
pass
if interface.defroute[0]:
config.append('DEFROUTE=%s' % interface.defroute[0])
pass
return config
......@@ -97,7 +100,15 @@ def generate_ifcfgv6(tree, interface, search, nameservers):
if not interface_is_static(interface):
config.append('IPV6INIT=yes')
config.append('IPV6_AUTOCONF=yes')
if interface.ipv6_defroute[0]:
config.append('IPV6_DEFROUTE=%s' % interface.ipv6_defroute[0])
pass
elif interface.defroute[0]:
config.append('IPV6_DEFROUTE=%s' % interface.defroute[0])
pass
else:
config.append('IPV6_DEFROUTE=yes')
pass
config.append('IPV6_PEERDNS=yes')
config.append('IPV6_PEERROUTES=yes')
config.append('IPV6_FAILURE_FATAL=no')
......@@ -121,7 +132,15 @@ def generate_ifcfgv6(tree, interface, search, nameservers):
if len(address):
config.append('IPV6INIT=yes')
config.append('IPV6_AUTOCONF=no')
if interface.ipv6_defroute[0]:
config.append('IPV6_DEFROUTE=%s' % interface.ipv6_defroute[0])
pass
elif interface.defroute[0]:
config.append('IPV6_DEFROUTE=%s' % interface.defroute[0])
pass
else:
config.append('IPV6_DEFROUTE=yes')
pass
config.append('IPV6_FAILURE_FATAL=no')
config.append('IPV6ADDR=%s' % address[0])
if gateway:
......@@ -165,9 +184,6 @@ def generate_ifcfg(tree, interface):
tmp = sorted(search, cmp=reverse_order)
config.append('SEARCH="%s"' % (' '.join(tmp)))
pass
if interface.defroute[0]:
config.append('DEFROUTE=%s' % interface.defroute[0])
pass
return '\n'.join(config) + '\n'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment