SHA256
1
0
forked from pool/cloud-init

- 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
This commit is contained in:
Robert Schweikert 2019-01-22 13:07:42 +00:00 committed by Git OBS Bridge
parent 3664ce1659
commit 343fb12d7e
3 changed files with 30 additions and 1 deletions

View File

@ -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)

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Jan 22 13:04:40 UTC 2019 - Robert Schweikert <rjschwei@suse.com>
- Add cloud-init-no-empty-resolv.patch (bsc#1119397)
-------------------------------------------------------------------
Mon Jan 7 20:22:39 UTC 2019 - Robert Schweikert <rjschwei@suse.com>

View File

@ -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