From 343fb12d7e2eefe801b12443b75906fdc63a32b9b9a6f5aace53b6f70547ad6d Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Tue, 22 Jan 2019 13:07:42 +0000 Subject: [PATCH] - Add cloud-init-no-empty-resolv.patch (bsc#1119397) OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=129 --- cloud-init-no-empty-resolv.patch | 21 +++++++++++++++++++++ cloud-init.changes | 5 +++++ cloud-init.spec | 5 ++++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 cloud-init-no-empty-resolv.patch diff --git a/cloud-init-no-empty-resolv.patch b/cloud-init-no-empty-resolv.patch new file mode 100644 index 0000000..349f254 --- /dev/null +++ b/cloud-init-no-empty-resolv.patch @@ -0,0 +1,21 @@ +--- cloudinit/net/sysconfig.py.orig ++++ cloudinit/net/sysconfig.py +@@ -545,6 +545,8 @@ class Renderer(renderer.Renderer): + content.add_nameserver(nameserver) + for searchdomain in network_state.dns_searchdomains: + content.add_search_domain(searchdomain) ++ if not content: ++ return content + header = _make_header(';') + content_str = str(content) + if not content_str.startswith(header): +@@ -658,7 +660,8 @@ class Renderer(renderer.Renderer): + dns_path = util.target_path(target, self.dns_path) + resolv_content = self._render_dns(network_state, + existing_dns_path=dns_path) +- util.write_file(dns_path, resolv_content, file_mode) ++ if resolv_content: ++ util.write_file(dns_path, resolv_content, file_mode) + if self.networkmanager_conf_path: + nm_conf_path = util.target_path(target, + self.networkmanager_conf_path) diff --git a/cloud-init.changes b/cloud-init.changes index c792340..e2af5cb 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jan 22 13:04:40 UTC 2019 - Robert Schweikert + +- Add cloud-init-no-empty-resolv.patch (bsc#1119397) + ------------------------------------------------------------------- Mon Jan 7 20:22:39 UTC 2019 - Robert Schweikert diff --git a/cloud-init.spec b/cloud-init.spec index 5c20d5d..52b8a1a 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,7 +1,7 @@ # # spec file for package cloud-init # -# Copyright (c) 2018 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -51,6 +51,8 @@ Patch43: cloud-init-write-routes.patch # Following submitted upstream Patch44: cloud-init-handle-def-route-set.patch # End lp#1812117 +# FIXME +Patch45: cloud-init-no-empty-resolv.patch BuildRequires: fdupes BuildRequires: filesystem @@ -197,6 +199,7 @@ Documentation and examples for cloud-init tools %patch42 %patch43 %patch44 +%patch45 %build %if 0%{?suse_version} && 0%{?suse_version} <= 1315