Commit 8867ff1b authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Fixed defroute handling

parent c6d8dc3c
/hostinfo
*.pyc
*~
...@@ -89,6 +89,9 @@ def generate_ifcfgv4(tree, interface, search, nameservers): ...@@ -89,6 +89,9 @@ def generate_ifcfgv4(tree, interface, search, nameservers):
pass pass
index = int('0%s' % index)+1 index = int('0%s' % index)+1
pass pass
if interface.defroute[0]:
config.append('DEFROUTE=%s' % interface.defroute[0])
pass
return config return config
...@@ -97,7 +100,15 @@ def generate_ifcfgv6(tree, interface, search, nameservers): ...@@ -97,7 +100,15 @@ def generate_ifcfgv6(tree, interface, search, nameservers):
if not interface_is_static(interface): if not interface_is_static(interface):
config.append('IPV6INIT=yes') config.append('IPV6INIT=yes')
config.append('IPV6_AUTOCONF=yes') config.append('IPV6_AUTOCONF=yes')
config.append('IPV6_DEFROUTE=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_PEERDNS=yes')
config.append('IPV6_PEERROUTES=yes') config.append('IPV6_PEERROUTES=yes')
config.append('IPV6_FAILURE_FATAL=no') config.append('IPV6_FAILURE_FATAL=no')
...@@ -121,7 +132,15 @@ def generate_ifcfgv6(tree, interface, search, nameservers): ...@@ -121,7 +132,15 @@ def generate_ifcfgv6(tree, interface, search, nameservers):
if len(address): if len(address):
config.append('IPV6INIT=yes') config.append('IPV6INIT=yes')
config.append('IPV6_AUTOCONF=no') config.append('IPV6_AUTOCONF=no')
config.append('IPV6_DEFROUTE=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_FAILURE_FATAL=no') config.append('IPV6_FAILURE_FATAL=no')
config.append('IPV6ADDR=%s' % address[0]) config.append('IPV6ADDR=%s' % address[0])
if gateway: if gateway:
...@@ -165,9 +184,6 @@ def generate_ifcfg(tree, interface): ...@@ -165,9 +184,6 @@ def generate_ifcfg(tree, interface):
tmp = sorted(search, cmp=reverse_order) tmp = sorted(search, cmp=reverse_order)
config.append('SEARCH="%s"' % (' '.join(tmp))) config.append('SEARCH="%s"' % (' '.join(tmp)))
pass pass
if interface.defroute[0]:
config.append('DEFROUTE=%s' % interface.defroute[0])
pass
return '\n'.join(config) + '\n' return '\n'.join(config) + '\n'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment