From c6626fface3635f76e9bebc83825e68a75830ea0 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Jan 05 2019 10:54:54 +0000 Subject: Fix https://bugs.centos.org/view.php?id=0015629 and https://bugzilla.redhat.com/show_bug.cgi?id=1653131 --- diff --git a/SOURCES/cloud-init-17.1-no-override-default-network.patch b/SOURCES/cloud-init-17.1-no-override-default-network.patch new file mode 100644 index 0000000..7c21c83 --- /dev/null +++ b/SOURCES/cloud-init-17.1-no-override-default-network.patch @@ -0,0 +1,200 @@ +diff -rup cloud-init-17.1.orig/cloudinit/net/sysconfig.py cloud-init-17.1/cloudinit/net/sysconfig.py +--- cloud-init-17.1.orig/cloudinit/net/sysconfig.py 2018-03-26 19:22:35.693111559 +0200 ++++ cloud-init-17.1/cloudinit/net/sysconfig.py 2018-03-26 23:47:41.424803588 +0200 +@@ -586,7 +586,17 @@ class Renderer(renderer.Renderer): + + # always write /etc/sysconfig/network configuration + sysconfig_path = util.target_path(target, "etc/sysconfig/network") +- netcfg = [_make_header(), 'NETWORKING=yes'] ++ # Make sure that existing lines, other than overriding ones, remain ++ netcfg = [] ++ for line in util.load_file(sysconfig_path, quiet=True).split('\n'): ++ if 'cloud-init' in line: ++ break ++ if not line.startswith(('NETWORKING=', ++ 'IPV6_AUTOCONF=', ++ 'NETWORKING_IPV6=')): ++ netcfg.append(line) ++ # Now generate the cloud-init portion of sysconfig/network ++ netcfg.extend([_make_header(), 'NETWORKING=yes']) + if network_state.use_ipv6: + netcfg.append('NETWORKING_IPV6=yes') + netcfg.append('IPV6_AUTOCONF=no') +diff -rup cloud-init-17.1.orig/tests/unittests/test_distros/test_netconfig.py cloud-init-17.1/tests/unittests/test_distros/test_netconfig.py +--- cloud-init-17.1.orig/tests/unittests/test_distros/test_netconfig.py 2018-03-26 19:22:35.717111557 +0200 ++++ cloud-init-17.1/tests/unittests/test_distros/test_netconfig.py 2018-03-26 22:08:25.008717651 +0200 +@@ -384,6 +384,82 @@ hn0: flags=8843 arch # https://bugzilla.redhat.com/show_bug.cgi?id=1067089 Obsoletes: cloud-init < 0.7.5-3 @@ -187,6 +191,9 @@ fi %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf %changelog +* Fri Dec 14 2018 Patrick Uiterwijk - 18.2-1.el7_6.1.0.1 +- Add patch to retain old values of /etc/sysconfig/network + * Thu Sep 27 2018 Miroslav Rezanina - 18.2-1.el7_6.1 - ci-Adding-systemd-mount-options-to-wait-for-cloud-init.patch [bz#1633282] - ci-Azure-Ignore-NTFS-mount-errors-when-checking-ephemer.patch [bz#1633282]