--- pyanaconda/network.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py index 503132a..524ddb3 100644 --- a/pyanaconda/network.py +++ b/pyanaconda/network.py @@ -828,6 +828,19 @@ def set_hostname(hn): iutil.execWithRedirect("hostname", ["-v", hn ], stdout="/dev/tty5", stderr="/dev/tty5")
+def get_NM_settings_value(iface, key1, key2): + value = "" + con = get_NM_connection(iface, spec_type="iface") + if con: + settings = con.GetSettings() + try: + value = settings[key1][key2] + except KeyError: + log.debug("Can't find setting %s %s for %s" % (key1, key2, iface)) + else: + log.debug("Can't find connection settings for %s" % iface) + return value + def write_hostname(rootpath, ksdata, overwrite=False): cfgfile = os.path.normpath(rootpath + hostnameFile) if (os.path.isfile(cfgfile) and not overwrite): @@ -842,8 +855,8 @@ def write_hostname(rootpath, ksdata, overwrite=False): def disableIPV6(rootpath): cfgfile = os.path.normpath(rootpath + ipv6ConfFile) if ('noipv6' in flags.cmdline - and not any(get_ifcfg_value(dev, 'IPV6INIT') == "yes" - for dev in getDevices())): + and all(get_NM_settings_value(dev, "ipv6", "method") == "ignore" + for dev in getDevices())): log.info('Disabling ipv6 on target system') f = open(cfgfile, "a") f.write("# Anaconda disabling ipv6 (noipv6 option)\n")