From d6986f4135354c96c0c3120fba1920571fad4f6a9f2968e12f5ddff4ca862802 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Wed, 7 Apr 2021 17:43:03 +0000 Subject: [PATCH] - Add cloud-init-bonding-opts.patch (bsc#1184085) + Write proper bonding option configuration for SLE/openSUSE - Fix application and inclusion of use_arroba_to_include_sudoers_directory-bsc_1181283.patchfix (bsc#1181283) OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=183 --- cloud-init-bonding-opts.patch | 70 +++++++++++++++++++++++++++++++++++ cloud-init.changes | 8 ++++ cloud-init.spec | 9 +++-- 3 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 cloud-init-bonding-opts.patch diff --git a/cloud-init-bonding-opts.patch b/cloud-init-bonding-opts.patch new file mode 100644 index 0000000..9eebdbc --- /dev/null +++ b/cloud-init-bonding-opts.patch @@ -0,0 +1,70 @@ +--- cloudinit/net/sysconfig.py.orig ++++ cloudinit/net/sysconfig.py +@@ -300,7 +300,8 @@ class Renderer(renderer.Renderer): + } + + # If these keys exist, then their values will be used to form +- # a BONDING_OPTS grouping; otherwise no grouping will be set. ++ # a BONDING_OPTS / BONDING_MODULE_OPTS grouping; otherwise no ++ # grouping will be set. + bond_tpl_opts = tuple([ + ('bond_mode', "mode=%s"), + ('bond_xmit_hash_policy', "xmit_hash_policy=%s"), +@@ -593,7 +594,7 @@ class Renderer(renderer.Renderer): + route_cfg[new_key] = route[old_key] + + @classmethod +- def _render_bonding_opts(cls, iface_cfg, iface): ++ def _render_bonding_opts(cls, iface_cfg, iface, flavor): + bond_opts = [] + for (bond_key, value_tpl) in cls.bond_tpl_opts: + # Seems like either dash or underscore is possible? +@@ -606,7 +607,18 @@ class Renderer(renderer.Renderer): + bond_opts.append(value_tpl % (bond_value)) + break + if bond_opts: +- iface_cfg['BONDING_OPTS'] = " ".join(bond_opts) ++ # suse uses the sysconfig support which requires ++ # BONDING_MODULE_OPTS see ++ # https://www.kernel.org/doc/Documentation/networking/bonding.txt ++ # 3.1 Configuration with Sysconfig Support ++ if flavor == 'suse': ++ iface_cfg['BONDING_MODULE_OPTS'] = " ".join(bond_opts) ++ # rhel uses initscript support and thus requires BONDING_OPTS ++ # this is also the old default see ++ # https://www.kernel.org/doc/Documentation/networking/bonding.txt ++ # 3.2 Configuration with Initscripts Support ++ else: ++ iface_cfg['BONDING_OPTS'] = " ".join(bond_opts) + + @classmethod + def _render_physical_interfaces( +@@ -634,7 +646,7 @@ class Renderer(renderer.Renderer): + for iface in network_state.iter_interfaces(bond_filter): + iface_name = iface['name'] + iface_cfg = iface_contents[iface_name] +- cls._render_bonding_opts(iface_cfg, iface) ++ cls._render_bonding_opts(iface_cfg, iface, flavor) + + # Ensure that the master interface (and any of its children) + # are actually marked as being bond types... +--- tests/unittests/test_net.py.orig ++++ tests/unittests/test_net.py +@@ -1528,7 +1528,7 @@ pre-down route del -net 10.0.0.0/8 gw 11 + 'expected_sysconfig_opensuse': { + 'ifcfg-bond0': textwrap.dedent("""\ + BONDING_MASTER=yes +- BONDING_OPTS="mode=active-backup """ ++ BONDING_MODULE_OPTS="mode=active-backup """ + """xmit_hash_policy=layer3+4 """ + """miimon=100" + BONDING_SLAVE_0=eth1 +@@ -2114,7 +2114,7 @@ iface bond0 inet6 static + 'expected_sysconfig_opensuse': { + 'ifcfg-bond0': textwrap.dedent("""\ + BONDING_MASTER=yes +- BONDING_OPTS="mode=active-backup xmit_hash_policy=layer3+4 """ ++ BONDING_MODULE_OPTS="mode=active-backup xmit_hash_policy=layer3+4 """ + """miimon=100 num_grat_arp=5 """ + """downdelay=10 updelay=20 """ + """fail_over_mac=active """ diff --git a/cloud-init.changes b/cloud-init.changes index 601e709..7f9226d 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Apr 7 17:35:46 UTC 2021 - Robert Schweikert + +- Add cloud-init-bonding-opts.patch (bsc#1184085) + + Write proper bonding option configuration for SLE/openSUSE +- Fix application and inclusion of + use_arroba_to_include_sudoers_directory-bsc_1181283.patchfix (bsc#1181283) + ------------------------------------------------------------------- Fri Jan 22 16:27:17 UTC 2021 - Jordi Massaguer diff --git a/cloud-init.spec b/cloud-init.spec index 6f86e66..8b698b4 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,7 +1,7 @@ # # spec file for package cloud-init # -# Copyright (c) 2019 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2021 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 @@ -41,7 +41,9 @@ Patch59: cloud-init-recognize-hpc.patch # FIXME https://github.com/canonical/cloud-init/commit/eea754492f074e00b601cf77aa278e3623857c5a Patch60: cloud-init-azure-def-usr-pass.patch Patch61: cloud-init-sle12-compat.patch -Patch70: use_arroba_to_include_sudoers_directory-bsc_1181283.patch +Patch70: use_arroba_to_include_sudoers_directory-bsc_1181283.patch +# FIXME https://github.com/canonical/cloud-init/pull/831 +Patch71: cloud-init-bonding-opts.patch BuildRequires: fdupes BuildRequires: filesystem # pkg-config is needed to find correct systemd unit dir @@ -142,8 +144,9 @@ Documentation and examples for cloud-init tools %patch60 %if 0%{?suse_version} < 1500 %patch61 -%patch70 %endif +%patch70 -p1 +%patch71 # patch in the full version to version.py version_pys=$(find . -name version.py -type f) [ -n "$version_pys" ] ||