- 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
This commit is contained in:
Robert Schweikert 2019-10-22 12:15:54 +00:00 committed by Git OBS Bridge
parent 0cb1bb89c1
commit e61b62e5b9
3 changed files with 24 additions and 0 deletions

View File

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

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Oct 22 12:13:59 UTC 2019 - Robert Schweikert <rjschwei@suse.com>
- 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 <rjschwei@suse.com>

View File

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