Hello community,

here is the log from the commit of package cloud-init for openSUSE:Factory 
checked in at 2019-10-05 16:16:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cloud-init (Old)
 and      /work/SRC/openSUSE:Factory/.cloud-init.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "cloud-init"

Sat Oct  5 16:16:17 2019 rev:61 rq:734782 version:19.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/cloud-init/cloud-init.changes    2019-09-11 
10:21:44.731500696 +0200
+++ /work/SRC/openSUSE:Factory/.cloud-init.new.2352/cloud-init.changes  
2019-10-05 16:16:19.382059392 +0200
@@ -1,0 +2,21 @@
+Tue Sep 24 19:50:33 UTC 2019 - Robert Schweikert <[email protected]>
+
+- Add cloud-init-after-wicked.patch
+  - Change the service order, the cloud-init service wants to run after
+    networking is started
+
+-------------------------------------------------------------------
+Tue Sep 24 18:46:00 UTC 2019 - Robert Schweikert <[email protected]>
+
+- Add cloud-init-noresolv-merge-no-dns-data.diff
+  - Avoid writing resolv.conf if the network configuration contains no
+    dns entries.
+
+-------------------------------------------------------------------
+Mon Sep 23 13:05:03 UTC 2019 - Robert Schweikert <[email protected]>
+
+- Follow up to update cloud-init-trigger-udev.patch (bsc#1144363)
+  - In this implementation the "name" is not yet an attribute, use
+    get() to obtain the value from a dict. Source code version confusion.
+
+-------------------------------------------------------------------

New:
----
  cloud-init-after-wicked.patch
  cloud-init-noresolv-merge-no-dns-data.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cloud-init.spec ++++++
--- /var/tmp/diff_new_pack.OZmuu6/_old  2019-10-05 16:16:19.910058016 +0200
+++ /var/tmp/diff_new_pack.OZmuu6/_new  2019-10-05 16:16:19.914058007 +0200
@@ -46,8 +46,12 @@
 Patch47:        cloud-init-trigger-udev.patch
 # FIXME (lp#1669875) patch by mvoelker@launchpad
 Patch48:        cloud-init-detect-nova.diff
-# FIXME (lp##1821102)
+# FIXME (lp#1821102)
 Patch49:        cloud-init-add-static-routes.diff
+# FIXME (lp#1843634)
+Patch50:        cloud-init-noresolv-merge-no-dns-data.diff
+# FIXME
+Patch51:        cloud-init-after-wicked.patch
 
 BuildRequires:  fdupes
 BuildRequires:  filesystem
@@ -193,6 +197,8 @@
 %patch47
 %patch48 -p1
 %patch49 -p1
+%patch50 -p1
+%patch51 -p1
 
 %build
 %if 0%{?suse_version} && 0%{?suse_version} <= 1315

++++++ cloud-init-after-wicked.patch ++++++
Index: cloud-init-19.1/systemd/cloud-init.service.tmpl
===================================================================
--- cloud-init-19.1.orig/systemd/cloud-init.service.tmpl
+++ cloud-init-19.1/systemd/cloud-init.service.tmpl
@@ -14,7 +14,7 @@ After=networking.service
 After=network.service
 {% endif %}
 {% if variant in ["suse"] %}
-Before=wicked.service
+After=wicked.service
 # setting hostname via hostnamectl depends on dbus, which otherwise
 # would not be guaranteed at this point.
 After=dbus.service
++++++ cloud-init-noresolv-merge-no-dns-data.diff ++++++
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index be5dede..1708990 100644
--- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py
@@ -578,6 +578,10 @@ class Renderer(renderer.Renderer):
 
     @staticmethod
     def _render_dns(network_state, existing_dns_path=None):
+        # skip writing resolv.conf if network_state doesn't include any input.
+        if not any([len(network_state.dns_nameservers),
+                    len(network_state.dns_searchdomains)]):
+            return None
         content = resolv_conf.ResolvConf("")
         if existing_dns_path and os.path.isfile(existing_dns_path):
             content = resolv_conf.ResolvConf(util.load_file(existing_dns_path))
@@ -585,8 +589,6 @@ class Renderer(renderer.Renderer):
             content.add_nameserver(nameserver)
         for searchdomain in network_state.dns_searchdomains:
             content.add_search_domain(searchdomain)
-        if not str(content):
-            return None
         header = _make_header(';')
         content_str = str(content)
         if not content_str.startswith(header):
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index e578992..82eb18f 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -2701,6 +2701,10 @@ USERCTL=no
         ns = network_state.parse_net_config_data(CONFIG_V1_EXPLICIT_LOOPBACK)
         render_dir = self.tmp_path("render")
         os.makedirs(render_dir)
+        # write an etc/resolv.conf and expect it to not be modified
+        resolvconf = os.path.join(render_dir, 'etc/resolv.conf')
+        content = "# Original Content"
+        util.write_file(resolvconf, content)
         renderer = self._get_renderer()
         renderer.render_network_state(ns, target=render_dir)
         found = dir2dict(render_dir)
@@ -2718,6 +2722,8 @@ TYPE=Ethernet
 USERCTL=no
 """
         self.assertEqual(expected, found[nspath + 'ifcfg-eth0'])
+        # a dhcp only config should not modify resolv.conf
+        self.assertEqual(content, found['/etc/resolv.conf'])
 
     def test_bond_config(self):
         expected_name = 'expected_sysconfig_rhel'
@@ -3202,6 +3208,10 @@ USERCTL=no
         ns = network_state.parse_net_config_data(CONFIG_V1_EXPLICIT_LOOPBACK)
         render_dir = self.tmp_path("render")
         os.makedirs(render_dir)
+        # write an etc/resolv.conf and expect it to not be modified
+        resolvconf = os.path.join(render_dir, 'etc/resolv.conf')
+        content = "# Original Content"
+        util.write_file(resolvconf, content)
         renderer = self._get_renderer()
         renderer.render_network_state(ns, target=render_dir)
         found = dir2dict(render_dir)
@@ -3219,6 +3229,8 @@ TYPE=Ethernet
 USERCTL=no
 """
         self.assertEqual(expected, found[nspath + 'ifcfg-eth0'])
+        # a dhcp only config should not modify resolv.conf
+        self.assertEqual(content, found['/etc/resolv.conf'])
 
     def test_bond_config(self):
         expected_name = 'expected_sysconfig_opensuse'
++++++ cloud-init-trigger-udev.patch ++++++
--- /var/tmp/diff_new_pack.OZmuu6/_old  2019-10-05 16:16:19.958057892 +0200
+++ /var/tmp/diff_new_pack.OZmuu6/_new  2019-10-05 16:16:19.958057892 +0200
@@ -27,7 +27,7 @@
 +            # before they are all setup. Settle if that is the case.
 +            for iface in network_state.iter_interfaces(
 +                    renderer.filter_by_physical):
-+                path = net.sys_dev_path(iface.name)
++                path = net.sys_dev_path(iface.get('name'))
 +                if not os.path.exists(path):
 +                    util.udevadm_settle(path, 5)
 +                    break


Reply via email to