From e61b62e5b916999962577df6b8bbcfda547bdc4af9da7c33319998d93359fe7d Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Tue, 22 Oct 2019 12:15:54 +0000 Subject: [PATCH 1/5] - Add cloud-init-break-resolv-symlink.patch (bsc#1151488) + If /etc/resolv.conf is a symlink break it. This will avoid netconfig from clobbering the changes cloud-init applied. OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=150 --- cloud-init-break-resolv-symlink.patch | 14 ++++++++++++++ cloud-init.changes | 7 +++++++ cloud-init.spec | 3 +++ 3 files changed, 24 insertions(+) create mode 100644 cloud-init-break-resolv-symlink.patch diff --git a/cloud-init-break-resolv-symlink.patch b/cloud-init-break-resolv-symlink.patch new file mode 100644 index 0000000..edb59b5 --- /dev/null +++ b/cloud-init-break-resolv-symlink.patch @@ -0,0 +1,14 @@ +--- cloudinit/net/sysconfig.py.orig ++++ cloudinit/net/sysconfig.py +@@ -705,6 +705,11 @@ class Renderer(renderer.Renderer): + resolv_content = self._render_dns(network_state, + existing_dns_path=dns_path) + if resolv_content: ++ # netconfig checks if /etc/resolv.conf is a symlink and if ++ # that is true will write it's version of the file clobbering ++ # our changes. ++ if os.path.islink(dns_path): ++ os.unlink(dns_path) + util.write_file(dns_path, resolv_content, file_mode) + if self.networkmanager_conf_path: + nm_conf_path = util.target_path(target, diff --git a/cloud-init.changes b/cloud-init.changes index 3d61cd6..27b6272 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Oct 22 12:13:59 UTC 2019 - Robert Schweikert + +- Add cloud-init-break-resolv-symlink.patch (bsc#1151488) + + If /etc/resolv.conf is a symlink break it. This will avoid netconfig + from clobbering the changes cloud-init applied. + ------------------------------------------------------------------- Thu Sep 26 12:15:50 UTC 2019 - Robert Schweikert diff --git a/cloud-init.spec b/cloud-init.spec index 99315a1..98f71d0 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -47,6 +47,8 @@ Patch47: cloud-init-trigger-udev.patch Patch50: cloud-init-noresolv-merge-no-dns-data.diff # FIXME expected in 19.3 Patch51: cloud-init-after-wicked.patch +# FIXME (lp#1849296) +Patch52: cloud-init-break-resolv-symlink.patch BuildRequires: fdupes BuildRequires: filesystem @@ -192,6 +194,7 @@ Documentation and examples for cloud-init tools %patch47 %patch50 -p1 %patch51 -p1 +%patch52 %build %if 0%{?suse_version} && 0%{?suse_version} <= 1315 From 0e6e7e2b35c9653ee2c61f7aeea8b5a7110f3c217472554080680dfc069cada8 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Tue, 22 Oct 2019 20:01:12 +0000 Subject: [PATCH 2/5] - Add cloud-init-renderer-detect.patch (bsc#1154092) + Short curcuit the conditional for identifying the sysconfig renderer. If we find ifup/ifdown accept the renderer as available. OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=151 --- cloud-init-renderer-detect.patch | 11 +++++++++++ cloud-init.changes | 7 +++++++ cloud-init.spec | 3 +++ 3 files changed, 21 insertions(+) create mode 100644 cloud-init-renderer-detect.patch diff --git a/cloud-init-renderer-detect.patch b/cloud-init-renderer-detect.patch new file mode 100644 index 0000000..1ebe677 --- /dev/null +++ b/cloud-init-renderer-detect.patch @@ -0,0 +1,11 @@ +--- cloudinit/net/sysconfig.py.orig ++++ cloudinit/net/sysconfig.py +@@ -758,6 +758,8 @@ def available_sysconfig(target=None): + for p in expected: + if not util.which(p, search=search, target=target): + return False ++ else: ++ return True + + expected_paths = ['etc/sysconfig/network/scripts/functions.netconfig'] + for p in expected_paths: diff --git a/cloud-init.changes b/cloud-init.changes index 27b6272..9816394 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Oct 22 19:57:22 UTC 2019 - Robert Schweikert + +- Add cloud-init-renderer-detect.patch (bsc#1154092) + + Short curcuit the conditional for identifying the sysconfig renderer. + If we find ifup/ifdown accept the renderer as available. + ------------------------------------------------------------------- Tue Oct 22 12:13:59 UTC 2019 - Robert Schweikert diff --git a/cloud-init.spec b/cloud-init.spec index 98f71d0..bac6c13 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -49,6 +49,8 @@ Patch50: cloud-init-noresolv-merge-no-dns-data.diff Patch51: cloud-init-after-wicked.patch # FIXME (lp#1849296) Patch52: cloud-init-break-resolv-symlink.patch +# FIXME +Patch53: cloud-init-renderer-detect.patch BuildRequires: fdupes BuildRequires: filesystem @@ -195,6 +197,7 @@ Documentation and examples for cloud-init tools %patch50 -p1 %patch51 -p1 %patch52 +%patch53 %build %if 0%{?suse_version} && 0%{?suse_version} <= 1315 From 40d14c477424b9c426e1866fb60b8e535d937d5d31d688b24859460aeca199ca Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Tue, 22 Oct 2019 20:06:25 +0000 Subject: [PATCH 3/5] - Add cloud-init-renderer-detect.patch (bsc#1154092, boo#1142988) OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=152 --- cloud-init.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud-init.changes b/cloud-init.changes index 9816394..f288ee0 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Tue Oct 22 19:57:22 UTC 2019 - Robert Schweikert -- Add cloud-init-renderer-detect.patch (bsc#1154092) +- Add cloud-init-renderer-detect.patch (bsc#1154092, boo#1142988) + Short curcuit the conditional for identifying the sysconfig renderer. If we find ifup/ifdown accept the renderer as available. From e57d5d52637d455ed90acb2abb9ffa480a936d8f3057bb1fe5419fc6ce8b138f Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Tue, 22 Oct 2019 20:48:20 +0000 Subject: [PATCH 4/5] - Add lp bug number for reference OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=153 --- cloud-init.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud-init.spec b/cloud-init.spec index bac6c13..3595248 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -49,7 +49,7 @@ Patch50: cloud-init-noresolv-merge-no-dns-data.diff Patch51: cloud-init-after-wicked.patch # FIXME (lp#1849296) Patch52: cloud-init-break-resolv-symlink.patch -# FIXME +# FIXME (lp#1849378) Patch53: cloud-init-renderer-detect.patch BuildRequires: fdupes From 29723d4dbe048bd2d8a12d6c1c618f51c324a34f37a9248d7e65fffb28bfbb64 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Tue, 22 Oct 2019 21:13:06 +0000 Subject: [PATCH 5/5] - Expand patch to more reliably detect the OS OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=154 --- cloud-init-renderer-detect.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cloud-init-renderer-detect.patch b/cloud-init-renderer-detect.patch index 1ebe677..2296c19 100644 --- a/cloud-init-renderer-detect.patch +++ b/cloud-init-renderer-detect.patch @@ -1,5 +1,14 @@ --- cloudinit/net/sysconfig.py.orig +++ cloudinit/net/sysconfig.py +@@ -748,7 +748,7 @@ class Renderer(renderer.Renderer): + def available(target=None): + sysconfig = available_sysconfig(target=target) + nm = available_nm(target=target) +- return (util.get_linux_distro()[0] in KNOWN_DISTROS ++ return (util.system_info()['variant'] in KNOWN_DISTROS + and any([nm, sysconfig])) + + @@ -758,6 +758,8 @@ def available_sysconfig(target=None): for p in expected: if not util.which(p, search=search, target=target):