Skip to content

Commit

Permalink
adapt to pr comments
Browse files Browse the repository at this point in the history
Signed-off-by: BenjiReis <[email protected]>
  • Loading branch information
benjamreis committed Nov 7, 2022
1 parent c0aaa6d commit 8ea4448
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
23 changes: 11 additions & 12 deletions backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1553,18 +1553,17 @@ def configureNetworking(mounts, admin_iface, admin_bridge, admin_config, hn_conf
# now we need to write /etc/sysconfig/network
nfd = open("%s/etc/sysconfig/network" % mounts["root"], "w")
nfd.write("NETWORKING=yes\n")
ipv6_conf = open("%s/etc/sysctl.d/91-net-ipv6.conf" % mounts["root"], "w")
if admin_config.modev6:
nfd.write("NETWORKING_IPV6=yes\n")
util.runCmd2(['chroot', mounts['root'], 'systemctl', 'enable', 'ip6tables'])
for i in ['all', 'default']:
ipv6_conf.write('net.ipv6.conf.%s.disable_ipv6=0\n' % i)
else:
nfd.write("NETWORKING_IPV6=no\n")
for i in ['all', 'default']:
ipv6_conf.write('net.ipv6.conf.%s.disable_ipv6=1\n' % i)
netutil.disable_ipv6_module(mounts["root"])
ipv6_conf.close()
with open("%s/etc/sysctl.d/91-net-ipv6.conf" % mounts["root"], "w") as ipv6_conf:
if admin_config.modev6:
nfd.write("NETWORKING_IPV6=yes\n")
util.runCmd2(['chroot', mounts['root'], 'systemctl', 'enable', 'ip6tables'])
for i in ['all', 'default']:
ipv6_conf.write('net.ipv6.conf.%s.disable_ipv6=0\n' % i)
else:
nfd.write("NETWORKING_IPV6=no\n")
for i in ['all', 'default']:
ipv6_conf.write('net.ipv6.conf.%s.disable_ipv6=1\n' % i)
netutil.disable_ipv6_module(mounts["root"])
nfd.write("IPV6_AUTOCONF=no\n")
nfd.write('NTPSERVERARGS="iburst prefer"\n')
nfd.close()
Expand Down
7 changes: 3 additions & 4 deletions upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,9 @@ def completeUpgrade(self, mounts, prev_install, target_disk, backup_partnum, log
netutil.disable_ipv6_module(mounts["root"])
else:
# Enable IPV6
ipv6_conf = open("%s/etc/sysctl.d/91-net-ipv6.conf" % mounts["root"], "w")
for i in ['all', 'default']:
ipv6_conf.write('net.ipv6.conf.%s.disable_ipv6=0\n' % i)
ipv6_conf.close()
with open("%s/etc/sysctl.d/91-net-ipv6.conf" % mounts["root"], "w") as ipv6_conf:
for i in ['all', 'default']:
ipv6_conf.write('net.ipv6.conf.%s.disable_ipv6=0\n' % i)

# handle the conversion of devices from aacraid to smartpqi
primary_disk = self.source.getInventoryValue("PRIMARY_DISK")
Expand Down

0 comments on commit 8ea4448

Please sign in to comment.