![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
From 1f7950f72dc5f3603118c0f91dca3fb7145f0801 Mon Sep 17 00:00:00 2001 From: Robert Schweikert <rjschwei@suse.com> Date: Wed, 24 Oct 2018 09:50:11 -0400 Subject: [PATCH] - Fix the service order for SUSE distributions + Network configuration file gets written when cloud-init.service runs. Therefore
Hello community, here is the log from the commit of package cloud-init for openSUSE:Factory checked in at 2018-10-29 14:21:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cloud-init (Old) and /work/SRC/openSUSE:Factory/.cloud-init.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "cloud-init" Mon Oct 29 14:21:17 2018 rev:53 rq:644740 version:18.4 Changes: -------- --- /work/SRC/openSUSE:Factory/cloud-init/cloud-init.changes 2018-05-23 16:09:51.556317737 +0200 +++ /work/SRC/openSUSE:Factory/.cloud-init.new/cloud-init.changes 2018-10-29 14:58:26.613977045 +0100 @@ -1,0 +2,263 @@ +Thu Oct 25 18:56:13 UTC 2018 - Robert Schweikert <rjschwei@suse.com> + +- Update to version 18.4 (bsc#1087331, bsc#1097388, boo#1111427, bsc#1095627) + + Remove cloud-init-no-user-lock-if-already-locked.patch + cloud-init 18.4 is not supported on SLE 11 code base + + Remove 0001-Support-chrony-configuration-lp-1731619.patch + Included upstream + + Remove 0003-Distro-dependent-chrony-config-file.patch + Included upstream + + Remove 0001-switch-to-using-iproute2-tools.patch + Included upstream + + Remove cloud-init-no-python-linux-dist.patch + Included upstream + + Remove cloud-init-no-trace-empt-sect.patch + Included upstream + + Remove cloud-init-setpath-dsitentify.patch + Included upstream + + Modify fix-default-systemd-unit-dir.patch + Use pkg-config, only modify the generator + + Remove cloud-init-sysconfig-netpathfix.patch + Fixed upstream + + Removed cloud-init-skip-ovf-tests.patch + Fixed upstream + + Removed cloud-init-translate-netconf-ipv4-keep-gw.patch + Fixed upstream + + Add cloud-init-template-py2.patch avoid Python 3 dependency when we build + for distros with Python 2 support + + Add 0001-Follow-the-ever-bouncing-ball-for-openSUSE-distribut.patch + + Add 0002-Add-tests-for-additional-openSUSE-distro-condition-m.patch + + Add cloud-init-sysconf-path.patch + + Add cloud-init-sysconf-ethsetup.patch + + Add 0001-Fix-the-service-order-for-SUSE-distributions.patch + + Add dhcp-client as requirement + cloud-init uses dhclient to setup temporary network for + metadata retrieval. THis is needed until lp#1733226 is addressed + + add rtd example docs about new standardized keys + + use ds._crawled_metadata instance attribute if set when writing + instance-data.json + + ec2: update crawled metadata. add standardized keys + + tests: allow skipping an entire cloud_test without running. + + tests: disable lxd tests on cosmic + + cii-tests: use unittest2.SkipTest in ntp_chrony due to new deps + + lxd: adjust to snap installed lxd. + + docs: surface experimental doc in instance-data.json + + tests: fix ec2 integration tests. process meta_data instead of meta-data + + Add support for Infiniband network interfaces (IPoIB). [Mark Goddard] + + cli: add cloud-init query subcommand to query instance metadata + + tools/tox-venv: update for new features. + + pylint: ignore warning assignment-from-no-return for _write_network + + stages: Fix bug causing datasource to have incorrect sys_cfg. + (LP: #1787459) + + Remove dead-code _write_network distro implementations. + + net_util: ensure static configs have netmask in translate_network result + [Thomas Berger] (LP: #1792454) + + Fall back to root:root on syslog permissions if other options fail. + [Robert Schweikert] + + tests: Add mock for util.get_hostname. [Robert Schweikert] (LP: #1792799) + + ds-identify: doc string cleanup. + + OpenStack: Support setting mac address on bond. + [Fabian Wiesel] (LP: #1682064) + + bash_completion/cloud-init: fix shell syntax error. + + EphemeralIPv4Network: Be more explicit when adding default route. + (LP: #1792415) + + OpenStack: support reading of newer versions of metdata. + + OpenStack: fix bug causing 'latest' version to be used from network. + (LP: #1792157) + + user-data: jinja template to render instance-data.json in cloud-config + (LP: #1791781) + + config: disable ssh access to a configured user account + + tests: print failed testname instead of docstring upon failure + + tests: Disallow use of util.subp except for where needed. + + sysconfig: refactor sysconfig to accept distro specific templates paths + + Add unit tests for config/cc_ssh.py [Francis Ginther] + + Fix the built-in cloudinit/tests/helpers:skipIf + + read-version: enhance error message [Joshua Powers] + + hyperv_reporting_handler: simplify threaded publisher + + VMWare: Fix a network config bug in vm with static IPv4 and no gateway. + [Pengpeng Sun] (LP: #1766538) + + logging: Add logging config type hyperv for reporting via Azure KVP + [Andy Liu] + + tests: disable other snap test as well [Joshua Powers] + + tests: disable snap, fix write_files binary [Joshua Powers] + + Add datasource Oracle Compute Infrastructure (OCI). + + azure: allow azure to generate network configuration from IMDS per boot. + + Scaleway: Add network configuration to the DataSource [Louis Bouchard] + + docs: Fix example cloud-init analyze command to match output. + [Wesley Gao] + + netplan: Correctly render macaddress on a bonds and bridges when + provided. (LP: #1784699) + + tools: Add 'net-convert' subcommand command to 'cloud-init devel'. + + redhat: remove ssh keys on new instance. (LP: #1781094) + + Use typeset or local in profile.d scripts. (LP: #1784713) + + OpenNebula: Fix null gateway6 [Akihiko Ota] (LP: #1768547) + + oracle: fix detect_openstack to report True on OracleCloud.com DMI data + (LP: #1784685) + + tests: improve LXDInstance trying to workaround or catch bug. + + update_metadata re-config on every boot comments and tests not quite + right [Mike Gerdts] + + tests: Collect build_info from system if available. + + pylint: Fix pylint warnings reported in pylint 2.0.0. + + get_linux_distro: add support for rhel via redhat-release. + + get_linux_distro: add support for centos6 and rawhide flavors of redhat + (LP: #1781229) + + tools: add '--debug' to tools/net-convert.py + + tests: bump the version of paramiko to 2.4.1. + + docs: note in rtd about avoiding /tmp when writing files (LP: #1727876) + + ubuntu,centos,debian: get_linux_distro to align with platform.dist + (LP: #1780481) + + Fix boothook docs on environment variable name (INSTANCE_I -> + INSTANCE_ID) [Marc Tamsky] + + update_metadata: a datasource can support network re-config every boot + + tests: drop salt-minion integration test (LP: #1778737) + + Retry on failed import of gpg receive keys. + + tools: Fix run-container when neither source or binary package requested. + + docs: Fix a small spelling error. [Oz N Tiram] + + tox: use simplestreams from git repository rather than bzr. +- From 18.3 + + docs: represent sudo:false in docs for user_groups config module + + Explicitly prevent `sudo` access for user module + [Jacob Bednarz] (LP: #1771468) + + lxd: Delete default network and detach device if lxd-init created them. + (LP: #1776958) + + openstack: avoid unneeded metadata probe on non-openstack platforms + (LP: #1776701) + + stages: fix tracebacks if a module stage is undefined or empty + [Robert Schweikert] (LP: #1770462) + + Be more safe on string/bytes when writing multipart user-data to disk. + (LP: #1768600) + + Fix get_proc_env for pids that have non-utf8 content in environment. + (LP: #1775371) + + tests: fix salt_minion integration test on bionic and later + + tests: provide human-readable integration test summary when --verbose + + tests: skip chrony integration tests on lxd running artful or older + + test: add optional --preserve-instance arg to integraiton tests + + netplan: fix mtu if provided by network config for all rendered types + (LP: #1774666) + + tests: remove pip install workarounds for pylxd, take upstream fix. + + subp: support combine_capture argument. + + tests: ordered tox dependencies for pylxd install + + util: add get_linux_distro function to replace platform.dist + [Robert Schweikert] (LP: #1745235) + + pyflakes: fix unused variable references identified by pyflakes 2.0.0. + + Do not use the systemd_prefix macro, not available in this environment + [Robert Schweikert] + + doc: Add config info to ec2, openstack and cloudstack datasource docs + + Enable SmartOS network metadata to work with netplan via per-subnet + routes [Dan McDonald] (LP: #1763512) + + openstack: Allow discovery in init-local using dhclient in a sandbox. + (LP: #1749717) + + tests: Avoid using https in httpretty, improve HttPretty test case. + (LP: #1771659) + + yaml_load/schema: Add invalid line and column nums to error message + + Azure: Ignore NTFS mount errors when checking ephemeral drive + [Paul Meyer] + + packages/brpm: Get proper dependencies for cmdline distro. + + packages: Make rpm spec files patch in package version like in debs. + + tools/run-container: replace tools/run-centos with more generic. + + Update version.version_string to contain packaged version. (LP: #1770712) + + cc_mounts: Do not add devices to fstab that are already present. + [Lars Kellogg-Stedman] + + ds-identify: ensure that we have certain tokens in PATH. (LP: #1771382) + + tests: enable Ubuntu Cosmic in integration tests [Joshua Powers] + + read_file_or_url: move to url_helper, fix bug in its FileResponse. + + cloud_tests: help pylint [Ryan Harper] + + flake8: fix flake8 errors in previous commit. + + typos: Fix spelling mistakes in cc_mounts.py log messages [Stephen Ford] + + tests: restructure SSH and initial connections [Joshua Powers] + + ds-identify: recognize container-other as a container, test SmartOS. + + cloud-config.service: run After snap.seeded.service. (LP: #1767131) + + tests: do not rely on host /proc/cmdline in test_net.py + [Lars Kellogg-Stedman] (LP: #1769952) + + ds-identify: Remove dupe call to is_ds_enabled, improve debug message. + + SmartOS: fix get_interfaces for nics that do not have addr_assign_type. + + tests: fix package and ca_cert cloud_tests on bionic + (LP: #1769985) + + ds-identify: make shellcheck 0.4.6 happy with ds-identify. + + pycodestyle: Fix deprecated string literals, move away from flake8. + + azure: Add reported ready marker file. [Joshua Chan] (LP: #1765214) + + tools: Support adding a release suffix through packages/bddeb. + + FreeBSD: Invoke growfs on ufs filesystems such that it does not prompt. + [Harm Weites] (LP: #1404745) + + tools: Re-use the orig tarball in packages/bddeb if it is around. + + netinfo: fix netdev_pformat when a nic does not have an address + assigned. (LP: #1766302) + + collect-logs: add -v flag, write to stderr, limit journal to single + boot. (LP: #1766335) + + IBMCloud: Disable config-drive and nocloud only if IBMCloud is enabled. + (LP: #1766401) + + Add reporting events and log_time around early source of blocking time + [Ryan Harper] + + IBMCloud: recognize provisioning environment during debug boots. + (LP: #1767166) + + net: detect unstable network names and trigger a settle if needed + [Ryan Harper] (LP: #1766287) + + IBMCloud: improve documentation in datasource. + + sysconfig: dhcp6 subnet type should not imply dhcpv4 [Vitaly Kuznetsov] + + packages/debian/control.in: add missing dependency on iproute2. ++++ 66 more lines (skipped) ++++ between /work/SRC/openSUSE:Factory/cloud-init/cloud-init.changes ++++ and /work/SRC/openSUSE:Factory/.cloud-init.new/cloud-init.changes Old: ---- 0001-Support-chrony-configuration-lp-1731619.patch 0001-switch-to-using-iproute2-tools.patch 0003-Distro-dependent-chrony-config-file.patch cloud-init-18.2.tar.gz cloud-init-no-python-linux-dist.patch cloud-init-no-trace-empt-sect.patch cloud-init-no-user-lock-if-already-locked.patch cloud-init-setpath-dsitentify.patch cloud-init-skip-ovf-tests.patch cloud-init-sysconfig-netpathfix.patch cloud-init-translate-netconf-ipv4-keep-gw.patch New: ---- 0001-Fix-the-service-order-for-SUSE-distributions.patch 0001-Follow-the-ever-bouncing-ball-for-openSUSE-distribut.patch 0002-Add-tests-for-additional-openSUSE-distro-condition-m.patch cloud-init-18.4.tar.gz cloud-init-sysconf-ethsetup.patch cloud-init-sysconf-path.patch cloud-init-template-py2.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cloud-init.spec ++++++ --- /var/tmp/diff_new_pack.QyToW5/_old 2018-10-29 14:58:27.157978015 +0100 +++ /var/tmp/diff_new_pack.QyToW5/_new 2018-10-29 14:58:27.157978015 +0100 @@ -18,7 +18,7 @@ %global configver 0.7 Name: cloud-init -Version: 18.2 +Version: 18.4 Release: 0 License: GPL-3.0 and AGPL-3.0 Summary: Cloud node initialization tool @@ -28,37 +28,28 @@ Source1: rsyslog-cloud-init.cfg -# FIXME cloud-init-translate-netconf-ipv4-keep-gw (bsc#1064854) -# proposed for upstream merge (lp#1732966) -Patch8: cloud-init-translate-netconf-ipv4-keep-gw.patch -Patch10: cloud-init-no-user-lock-if-already-locked.patch +# FIXME +# proposed for upstream merge +# https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/35609... Patch12: fix-default-systemd-unit-dir.patch # python2 disables SIGPIPE, causing broken pipe errors in shell scripts (bsc#903449) Patch20: cloud-init-python2-sigpipe.patch -Patch27: cloud-init-sysconfig-netpathfix.patch +Patch21: cloud-init-template-py2.patch Patch29: datasourceLocalDisk.patch Patch34: cloud-init-tests-set-exec.patch -# FIXME chrony support upstream -# These patches represent a working appraoch to supporting chrony -# Upstream is seeking a significant re-write which is not likely to happen -# before we need chrony support -Patch37: 0001-Support-chrony-configuration-lp-1731619.patch -Patch39: 0003-Distro-dependent-chrony-config-file.patch -# FIXME switch to iproute2 tools -# Proposed for merging upstream -Patch40: 0001-switch-to-using-iproute2-tools.patch -# FIXME do not use platform.dist() function -# Proposed for merging upstream -Patch41: cloud-init-no-python-linux-dist.patch -# Disable OVF tests -Patch42: cloud-init-skip-ovf-tests.patch -# FIXME no traceback for empt stage -# #lp1770462 -# https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/34537... -Patch43: cloud-init-no-trace-empt-sect.patch -# FIXME cloud-init-setpath-gen.patch (boo#1093501) -# Merged upstream remove for 18.3 -Patch44: cloud-init-setpath-dsitentify.patch +# FIXME +# https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/35764... +Patch36: 0001-Follow-the-ever-bouncing-ball-for-openSUSE-distribut.patch +Patch37: 0002-Add-tests-for-additional-openSUSE-distro-condition-m.patch +# FIXME no proposed solution +Patch38: cloud-init-sysconf-path.patch +# FIXME (lp#1799540) +# https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/35771... +Patch39: cloud-init-sysconf-ethsetup.patch +# FIXME (lp#1799709) +# https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/35775... +Patch40: 0001-Fix-the-service-order-for-SUSE-distributions.patch + BuildRequires: fdupes BuildRequires: filesystem # pkg-config is needed to find correct systemd unit dir @@ -94,6 +85,7 @@ %endif BuildRequires: util-linux Requires: bash +Requires: dhcp-client Requires: file Requires: growpart Requires: e2fsprogs @@ -190,22 +182,18 @@ %prep %setup -q -%patch8 -%patch10 -p1 %patch12 %if 0%{?suse_version} < 1315 %patch20 +%patch21 %endif -%patch27 %patch29 -p0 %patch34 -%patch37 +%patch36 -p1 +%patch37 -p1 +%patch38 %patch39 -p1 %patch40 -p1 -%patch41 -%patch42 -%patch43 -%patch44 %build %if 0%{?suse_version} && 0%{?suse_version} <= 1315 @@ -302,6 +290,7 @@ %config(noreplace) %{_sysconfdir}/cloud/templates %{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient %{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager +%{_sysconfdir}/bash_completion.d/cloud-init %if 0%{?suse_version} && 0%{?suse_version} <= 1315 %{python_sitelib}/cloudinit %{python_sitelib}/cloud_init-%{version}-py%{py_ver}.egg-info ++++++ 0001-Fix-the-service-order-for-SUSE-distributions.patch ++++++ this needs to run prior to the network tools (wicked) --- systemd/cloud-init.service.tmpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl index b92e8abc..5cb00371 100644 --- a/systemd/cloud-init.service.tmpl +++ b/systemd/cloud-init.service.tmpl @@ -14,8 +14,7 @@ After=networking.service After=network.service {% endif %} {% if variant in ["suse"] %} -Requires=wicked.service -After=wicked.service +Before=wicked.service # setting hostname via hostnamectl depends on dbus, which otherwise # would not be guaranteed at this point. After=dbus.service -- 2.13.7 ++++++ 0001-Follow-the-ever-bouncing-ball-for-openSUSE-distribut.patch ++++++
From eb504025c76909175ab2d00c25232b89faf01ab4 Mon Sep 17 00:00:00 2001 From: Robert Schweikert <rjschwei@suse.com> Date: Sun, 21 Oct 2018 08:28:21 -0400 Subject: [PATCH 1/2] - Follow the ever bouncing ball for openSUSE distribution identification + openSUSE changed from identifying itself as "opensuse" in os-release to "opensuse-tumbleweed" and "opensuse-leap". This breaks template expansion
--- cloudinit/util.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cloudinit/util.py b/cloudinit/util.py index c67d6be6..7800f7bc 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -615,8 +615,8 @@ def get_linux_distro(): distro_name = os_release.get('ID', '') distro_version = os_release.get('VERSION_ID', '') if 'sles' in distro_name or 'suse' in distro_name: - # RELEASE_BLOCKER: We will drop this sles ivergent behavior in - # before 18.4 so that get_linux_distro returns a named tuple + # RELEASE_BLOCKER: We will drop this sles divergent behavior in + # the future so that get_linux_distro returns a named tuple # which will include both version codename and architecture # on all distributions. flavor = platform.machine() @@ -668,7 +668,8 @@ def system_info(): var = 'ubuntu' elif linux_dist == 'redhat': var = 'rhel' - elif linux_dist in ('opensuse', 'sles'): + elif linux_dist in ( + 'opensuse', 'opensuse-tumbleweed', 'opensuse-leap', 'sles'): var = 'suse' else: var = 'linux' -- 2.13.7 ++++++ 0002-Add-tests-for-additional-openSUSE-distro-condition-m.patch ++++++
From 33d988113c3897ea7e0d1eda402d30dfec119602 Mon Sep 17 00:00:00 2001 From: Robert Schweikert <rjschwei@suse.com> Date: Sun, 21 Oct 2018 08:46:15 -0400 Subject: [PATCH 2/2] - Add tests for additional openSUSE distro condition mechanisms
--- cloudinit/tests/test_util.py | 75 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 16 deletions(-) diff --git a/cloudinit/tests/test_util.py b/cloudinit/tests/test_util.py index 749a3846..c3f52c7b 100644 --- a/cloudinit/tests/test_util.py +++ b/cloudinit/tests/test_util.py @@ -18,25 +18,51 @@ MOUNT_INFO = [ ] OS_RELEASE_SLES = dedent("""\ - NAME="SLES"\n - VERSION="12-SP3"\n - VERSION_ID="12.3"\n - PRETTY_NAME="SUSE Linux Enterprise Server 12 SP3"\n - ID="sles"\nANSI_COLOR="0;32"\n - CPE_NAME="cpe:/o:suse:sles:12:sp3"\n + NAME="SLES" + VERSION="12-SP3" + VERSION_ID="12.3" + PRETTY_NAME="SUSE Linux Enterprise Server 12 SP3" + ID="sles" + ANSI_COLOR="0;32" + CPE_NAME="cpe:/o:suse:sles:12:sp3" """) OS_RELEASE_OPENSUSE = dedent("""\ -NAME="openSUSE Leap" -VERSION="42.3" -ID=opensuse -ID_LIKE="suse" -VERSION_ID="42.3" -PRETTY_NAME="openSUSE Leap 42.3" -ANSI_COLOR="0;32" -CPE_NAME="cpe:/o:opensuse:leap:42.3" -BUG_REPORT_URL="https://bugs.opensuse.org" -HOME_URL="https://www.opensuse.org/" + NAME="openSUSE Leap" + VERSION="42.3" + ID=opensuse + ID_LIKE="suse" + VERSION_ID="42.3" + PRETTY_NAME="openSUSE Leap 42.3" + ANSI_COLOR="0;32" + CPE_NAME="cpe:/o:opensuse:leap:42.3" + BUG_REPORT_URL="https://bugs.opensuse.org" + HOME_URL="https://www.opensuse.org/" +""") + +OS_RELEASE_OPENSUSE_L15 = dedent("""\ + NAME="openSUSE Leap" + VERSION="15.0" + ID="opensuse-leap" + ID_LIKE="suse opensuse" + VERSION_ID="15.0" + PRETTY_NAME="openSUSE Leap 15.0" + ANSI_COLOR="0;32" + CPE_NAME="cpe:/o:opensuse:leap:15.0" + BUG_REPORT_URL="https://bugs.opensuse.org" + HOME_URL="https://www.opensuse.org/" +""") + +OS_RELEASE_OPENSUSE_TW = dedent("""\ + NAME="openSUSE Tumbleweed" + ID="opensuse-tumbleweed" + ID_LIKE="opensuse suse" + VERSION_ID="20180920" + PRETTY_NAME="openSUSE Tumbleweed" + ANSI_COLOR="0;32" + CPE_NAME="cpe:/o:opensuse:tumbleweed:20180920" + BUG_REPORT_URL="https://bugs.opensuse.org" + HOME_URL="https://www.opensuse.org/" """) OS_RELEASE_CENTOS = dedent("""\ @@ -453,6 +479,23 @@ class TestGetLinuxDistro(CiTestCase): dist = util.get_linux_distro() self.assertEqual(('opensuse', '42.3', platform.machine()), dist) + @mock.patch('cloudinit.util.load_file') + def test_get_linux_opensuse_l15(self, m_os_release, m_path_exists): + """Verify we get the correct name and machine arch on OpenSUSE.""" + m_os_release.return_value = OS_RELEASE_OPENSUSE_L15 + m_path_exists.side_effect = TestGetLinuxDistro.os_release_exists + dist = util.get_linux_distro() + self.assertEqual(('opensuse-leap', '15.0', platform.machine()), dist) + + @mock.patch('cloudinit.util.load_file') + def test_get_linux_opensuse_tw(self, m_os_release, m_path_exists): + """Verify we get the correct name and machine arch on OpenSUSE.""" + m_os_release.return_value = OS_RELEASE_OPENSUSE_TW + m_path_exists.side_effect = TestGetLinuxDistro.os_release_exists + dist = util.get_linux_distro() + self.assertEqual( + ('opensuse-tumbleweed', '20180920', platform.machine()), dist) + @mock.patch('platform.dist') def test_get_linux_distro_no_data(self, m_platform_dist, m_path_exists): """Verify we get no information if os-release does not exist""" -- 2.13.7 ++++++ cloud-init-18.2.tar.gz -> cloud-init-18.4.tar.gz ++++++ ++++ 27471 lines of diff (skipped) ++++++ cloud-init-sysconf-ethsetup.patch ++++++
From 6732e10fa677566a2ddcbc7ff6727cf697d35761 Mon Sep 17 00:00:00 2001 From: Robert Schweikert <rjschwei@suse.com> Date: Tue, 23 Oct 2018 12:37:19 -0400 Subject: [PATCH] - Follow up to db50bc0d9 + ONBOOT is not recognized on openSUSE and SUSE Linux Enterprise, add the STARTMODE setting
--- cloudinit/net/sysconfig.py | 2 + .../unittests/test_distros/test_netconfig.py | 8 ++++ tests/unittests/test_net.py | 40 +++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py index 9c16d3a7..ff847038 100644 --- a/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py @@ -242,6 +242,7 @@ class Renderer(renderer.Renderer): ('USERCTL', False), ('NM_CONTROLLED', False), ('BOOTPROTO', 'none'), + ('STARTMODE', 'auto'), ]) # If these keys exist, then their values will be used to form @@ -336,6 +337,7 @@ class Renderer(renderer.Renderer): iface_cfg.name)) if subnet.get('control') == 'manual': iface_cfg['ONBOOT'] = False + iface_cfg['STARTMODE'] = 'manual' # set IPv4 and IPv6 static addresses ipv4_index = -1 diff --git a/tests/unittests/test_distros/test_netconfig.py b/tests/unittests/test_distros/test_netconfig.py index 6e339355..e986b593 100644 --- a/tests/unittests/test_distros/test_netconfig.py +++ b/tests/unittests/test_distros/test_netconfig.py @@ -468,6 +468,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): NETMASK=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -476,6 +477,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): DEVICE=eth1 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -499,6 +501,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): IPV6_DEFAULTGW=2607:f0d0:1002:0011::1 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -507,6 +510,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): DEVICE=eth1 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -559,6 +563,7 @@ class TestNetCfgDistroOpensuse(TestNetCfgDistroBase): NETMASK=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -567,6 +572,7 @@ class TestNetCfgDistroOpensuse(TestNetCfgDistroBase): DEVICE=eth1 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -587,6 +593,7 @@ class TestNetCfgDistroOpensuse(TestNetCfgDistroBase): IPV6_DEFAULTGW=2607:f0d0:1002:0011::1 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -595,6 +602,7 @@ class TestNetCfgDistroOpensuse(TestNetCfgDistroBase): DEVICE=eth1 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py index 8e383739..d94b9430 100644 --- a/tests/unittests/test_net.py +++ b/tests/unittests/test_net.py @@ -144,6 +144,7 @@ IPADDR=172.19.1.34 NETMASK=255.255.252.0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """.lstrip()), @@ -177,6 +178,7 @@ IPADDR=172.19.1.34 NETMASK=255.255.252.0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """.lstrip()), @@ -246,6 +248,7 @@ NETMASK=255.255.252.0 NETMASK1=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """.lstrip()), @@ -281,6 +284,7 @@ NETMASK=255.255.252.0 NETMASK1=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """.lstrip()), @@ -372,6 +376,7 @@ IPV6_DEFAULTGW=2001:DB8::1 NETMASK=255.255.252.0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """.lstrip()), @@ -409,6 +414,7 @@ IPV6_DEFAULTGW=2001:DB8::1 NETMASK=255.255.252.0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """.lstrip()), @@ -524,6 +530,7 @@ NETWORK_CONFIGS = { HWADDR=cf:d6:af:48:e8:80 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no"""), 'ifcfg-eth99': textwrap.dedent("""\ @@ -539,6 +546,7 @@ NETWORK_CONFIGS = { NETMASK=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no"""), }, @@ -652,6 +660,7 @@ NETWORK_CONFIGS = { NETMASK=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no MTU=9000 @@ -691,6 +700,7 @@ NETWORK_CONFIGS = { DEVICE=iface0 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -894,6 +904,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true MACADDR=aa:bb:cc:dd:ee:ff NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Bond USERCTL=no"""), 'ifcfg-bond0.200': textwrap.dedent("""\ @@ -902,6 +913,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NM_CONTROLLED=no ONBOOT=yes PHYSDEV=bond0 + STARTMODE=auto TYPE=Ethernet USERCTL=no VLAN=yes"""), @@ -919,6 +931,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NM_CONTROLLED=no ONBOOT=yes PRIO=22 + STARTMODE=auto STP=no TYPE=Bridge USERCTL=no"""), @@ -928,6 +941,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true HWADDR=c0:d6:9f:2c:e8:80 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no"""), 'ifcfg-eth0.101': textwrap.dedent("""\ @@ -946,6 +960,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NM_CONTROLLED=no ONBOOT=yes PHYSDEV=eth0 + STARTMODE=auto TYPE=Ethernet USERCTL=no VLAN=yes"""), @@ -956,6 +971,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true MASTER=bond0 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto SLAVE=yes TYPE=Ethernet USERCTL=no"""), @@ -966,6 +982,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true MASTER=bond0 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto SLAVE=yes TYPE=Ethernet USERCTL=no"""), @@ -976,6 +993,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true HWADDR=66:bb:9f:2c:e8:80 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no"""), 'ifcfg-eth4': textwrap.dedent("""\ @@ -985,6 +1003,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true HWADDR=98:bb:9f:2c:e8:80 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no"""), 'ifcfg-eth5': textwrap.dedent("""\ @@ -993,6 +1012,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true HWADDR=98:bb:9f:2c:e8:8a NM_CONTROLLED=no ONBOOT=no + STARTMODE=manual TYPE=Ethernet USERCTL=no""") }, @@ -1282,6 +1302,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NETMASK1=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Bond USERCTL=no """), @@ -1293,6 +1314,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NM_CONTROLLED=no ONBOOT=yes SLAVE=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -1309,6 +1331,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NM_CONTROLLED=no ONBOOT=yes SLAVE=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -1334,6 +1357,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NETMASK1=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Bond USERCTL=no """), @@ -1345,6 +1369,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NM_CONTROLLED=no ONBOOT=yes SLAVE=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -1363,6 +1388,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NM_CONTROLLED=no ONBOOT=yes SLAVE=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -1400,6 +1426,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true HWADDR=aa:bb:cc:dd:e8:00 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no"""), 'ifcfg-en0.99': textwrap.dedent("""\ @@ -1418,6 +1445,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NM_CONTROLLED=no ONBOOT=yes PHYSDEV=en0 + STARTMODE=auto TYPE=Ethernet USERCTL=no VLAN=yes"""), @@ -1459,6 +1487,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NM_CONTROLLED=no ONBOOT=yes PRIO=22 + STARTMODE=auto STP=no TYPE=Bridge USERCTL=no @@ -1472,6 +1501,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true IPV6INIT=yes NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -1484,6 +1514,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true IPV6INIT=yes NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -1558,6 +1589,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true NETMASK=255.255.255.0 NM_CONTROLLED=no ONBOOT=no + STARTMODE=manual TYPE=Ethernet USERCTL=no """), @@ -1568,6 +1600,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true MTU=1480 NM_CONTROLLED=no ONBOOT=yes + STARTMODE=auto TYPE=Ethernet USERCTL=no """), @@ -1577,6 +1610,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true HWADDR=52:54:00:12:34:ff NM_CONTROLLED=no ONBOOT=no + STARTMODE=manual TYPE=Ethernet USERCTL=no """), @@ -1933,6 +1967,7 @@ DEVICE=eth1000 HWADDR=07-1C-C6-75-A4-BE NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """.lstrip() @@ -2054,6 +2089,7 @@ IPADDR=10.0.2.15 NETMASK=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """ @@ -2075,6 +2111,7 @@ BOOTPROTO=dhcp DEVICE=eth0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """ @@ -2222,6 +2259,7 @@ DEVICE=eth1000 HWADDR=07-1C-C6-75-A4-BE NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """.lstrip() @@ -2343,6 +2381,7 @@ IPADDR=10.0.2.15 NETMASK=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """ @@ -2364,6 +2403,7 @@ BOOTPROTO=dhcp DEVICE=eth0 NM_CONTROLLED=no ONBOOT=yes +STARTMODE=auto TYPE=Ethernet USERCTL=no """ -- 2.19.0 ++++++ cloud-init-sysconf-path.patch ++++++ --- cloudinit/net/sysconfig.py.orig +++ cloudinit/net/sysconfig.py @@ -660,9 +660,7 @@ def available(target=None): if not util.which(p, search=search, target=target): return False - expected_paths = [ - 'etc/sysconfig/network-scripts/network-functions', - 'etc/sysconfig/network-scripts/ifdown-eth'] + expected_paths = ['etc/sysconfig/network/scripts/functions.netconfig'] for p in expected_paths: if not os.path.isfile(util.target_path(target, p)): return False ++++++ cloud-init-template-py2.patch ++++++ --- tools/render-cloudcfg.orig +++ tools/render-cloudcfg @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import argparse import os ++++++ fix-default-systemd-unit-dir.patch ++++++ --- /var/tmp/diff_new_pack.QyToW5/_old 2018-10-29 14:58:27.429978498 +0100 +++ /var/tmp/diff_new_pack.QyToW5/_new 2018-10-29 14:58:27.429978498 +0100 @@ -1,18 +1,3 @@ -Index: setup.py -=================================================================== ---- setup.py.orig -+++ setup.py -@@ -52,8 +52,8 @@ def tiny_p(cmd, capture=True): - def pkg_config_read(library, var): - fallbacks = { - 'systemd': { -- 'systemdsystemunitdir': '/lib/systemd/system', -- 'systemdsystemgeneratordir': '/lib/systemd/system-generators', -+ 'systemdsystemunitdir': '/usr/lib/systemd/system', -+ 'systemdsystemgeneratordir': '/usr/lib/systemd/system-generators', - } - } - cmd = ['pkg-config', '--variable=%s' % var, library] Index: systemd/cloud-init-generator =================================================================== --- systemd/cloud-init-generator.orig