From 1475962d0531d33b3847f75b736f416177ee96636eb3a4b7d264658aa6e4a393 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Fri, 5 Apr 2024 15:21:59 +0000 Subject: [PATCH 1/4] - Add cloud-init-no-openstack-guess.patch (bsc#1222113) + Do not guess if we are running on OpenStack or not. Only recognize the known markers and enable cloud-init if we know for sure. OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=227 --- cloud-init-no-openstack-guess.patch | 26 ++++++++++++++++++++++++++ cloud-init.changes | 7 +++++++ cloud-init.spec | 4 +++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 cloud-init-no-openstack-guess.patch diff --git a/cloud-init-no-openstack-guess.patch b/cloud-init-no-openstack-guess.patch new file mode 100644 index 0000000..537ceed --- /dev/null +++ b/cloud-init-no-openstack-guess.patch @@ -0,0 +1,26 @@ +--- tools/ds-identify.orig ++++ tools/ds-identify +@@ -1261,12 +1261,6 @@ dscheck_OpenStack() { + return ${DS_FOUND} + fi + +- # LP: #1715241 : arch other than intel are not identified properly. +- case "$DI_UNAME_MACHINE" in +- i?86|x86_64) :;; +- *) return ${DS_MAYBE};; +- esac +- + return ${DS_NOT_FOUND} + } + +--- tests/unittests/test_ds_identify.py.orig ++++ tests/unittests/test_ds_identify.py +@@ -574,7 +574,7 @@ class TestDsIdentify(DsIdentifyBase): + + nova does not identify itself on platforms other than intel. + https://bugs.launchpad.net/cloud-init/+bugs?field.tag=dsid-nova""" +- ++ return + data = copy.deepcopy(VALID_CFG["OpenStack"]) + del data["files"][P_PRODUCT_NAME] + data.update( diff --git a/cloud-init.changes b/cloud-init.changes index 3372b7d..bcab189 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Apr 5 14:27:16 UTC 2024 - Robert Schweikert + +- Add cloud-init-no-openstack-guess.patch (bsc#1222113) + + Do not guess if we are running on OpenStack or not. Only recognize + the known markers and enable cloud-init if we know for sure. + ------------------------------------------------------------------- Thu Mar 28 12:22:05 UTC 2024 - Robert Schweikert diff --git a/cloud-init.spec b/cloud-init.spec index 5d8d3d7..35a37f0 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -43,8 +43,9 @@ Patch8: cloud-init-lint-fixes.patch Patch9: cloud-init-pckg-reboot.patch # FIXME Patch10: cloud-init-skip-empty-conf.patch -# FIXME (ttps://github.com/canonical/cloud-init/issues/5075) +# FIXME (https://github.com/canonical/cloud-init/commit/d0f00bd54649e527d69ad597cbcad6efa8548e58) Patch11: cloud-init-ds-deterministic.patch +Patch12: cloud-init-no-openstack-guess.patch BuildRequires: fdupes BuildRequires: filesystem # pkg-config is needed to find correct systemd unit dir @@ -154,6 +155,7 @@ Documentation and examples for cloud-init tools %patch -P 9 %patch -P 10 %patch -P 11 +%patch -P 12 # patch in the full version to version.py version_pys=$(find . -name version.py -type f) From 85133088759a0d029e4784a39716a597ec47dd8734694a300d7c737743dfe285 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Fri, 5 Apr 2024 16:26:00 +0000 Subject: [PATCH 2/4] add comment w.r.t patch OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=228 --- cloud-init.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/cloud-init.spec b/cloud-init.spec index 35a37f0..8ac0b26 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -45,6 +45,7 @@ Patch9: cloud-init-pckg-reboot.patch Patch10: cloud-init-skip-empty-conf.patch # FIXME (https://github.com/canonical/cloud-init/commit/d0f00bd54649e527d69ad597cbcad6efa8548e58) Patch11: cloud-init-ds-deterministic.patch +# FIXME https://github.com/canonical/cloud-init/issues/5152 adn LP#1715241 Patch12: cloud-init-no-openstack-guess.patch BuildRequires: fdupes BuildRequires: filesystem From c9dc72d3d43f53fd17667f0ac32250285116f93a486dab4b25069b769603eb8f Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Fri, 5 Apr 2024 18:16:25 +0000 Subject: [PATCH 3/4] - Add cloud-init-no-nmcfg-needed.patch (bsc#1221726) + Do not require a NetworkManager config file in order to detect NetworkManager as the renderer OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=229 --- cloud-init-no-nmcfg-needed.patch | 27 +++++++++++++++++++++++++++ cloud-init.changes | 7 +++++++ cloud-init.spec | 3 +++ 3 files changed, 37 insertions(+) create mode 100644 cloud-init-no-nmcfg-needed.patch diff --git a/cloud-init-no-nmcfg-needed.patch b/cloud-init-no-nmcfg-needed.patch new file mode 100644 index 0000000..527847a --- /dev/null +++ b/cloud-init-no-nmcfg-needed.patch @@ -0,0 +1,27 @@ +--- cloudinit/net/network_manager.py.orig ++++ cloudinit/net/network_manager.py +@@ -9,7 +9,6 @@ + import configparser + import io + import itertools +-import os + import uuid + from typing import Optional + +@@ -401,7 +400,6 @@ def available(target=None): + # It is imported here to avoid circular import + from cloudinit.distros import uses_systemd + +- config_present = os.path.isfile(subp.target_path(target, path=NM_CFG_FILE)) + nmcli_present = subp.which("nmcli", target=target) + service_active = True + if uses_systemd(): +@@ -410,7 +408,7 @@ def available(target=None): + except subp.ProcessExecutionError: + service_active = False + +- return config_present and bool(nmcli_present) and service_active ++ return bool(nmcli_present) and service_active + + + # vi: ts=4 expandtab diff --git a/cloud-init.changes b/cloud-init.changes index bcab189..da23544 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Apr 5 18:01:39 UTC 2024 - Robert Schweikert + +- Add cloud-init-no-nmcfg-needed.patch (bsc#1221726) + + Do not require a NetworkManager config file in order to detect + NetworkManager as the renderer + ------------------------------------------------------------------- Fri Apr 5 14:27:16 UTC 2024 - Robert Schweikert diff --git a/cloud-init.spec b/cloud-init.spec index 8ac0b26..c880def 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -47,6 +47,8 @@ Patch10: cloud-init-skip-empty-conf.patch Patch11: cloud-init-ds-deterministic.patch # FIXME https://github.com/canonical/cloud-init/issues/5152 adn LP#1715241 Patch12: cloud-init-no-openstack-guess.patch +# FIXME upstream comit 812df5038 +Patch13: cloud-init-no-nmcfg-needed.patch BuildRequires: fdupes BuildRequires: filesystem # pkg-config is needed to find correct systemd unit dir @@ -157,6 +159,7 @@ Documentation and examples for cloud-init tools %patch -P 10 %patch -P 11 %patch -P 12 +%patch -P 13 # patch in the full version to version.py version_pys=$(find . -name version.py -type f) From b76642396edb3d9f8029a64ade48df9a9d41aa6f3f292ad2374d902f22709fa6 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Tue, 9 Apr 2024 16:09:39 +0000 Subject: [PATCH 4/4] - Update cloud-init-no-openstack-guess.patch + Do not enable cloud-init on systems where there is no DMI just because no data source has been found. No data source means cloud-init will not run. OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=230 --- cloud-init-no-openstack-guess.patch | 9 +++++++++ cloud-init.changes | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/cloud-init-no-openstack-guess.patch b/cloud-init-no-openstack-guess.patch index 537ceed..0c7b1e3 100644 --- a/cloud-init-no-openstack-guess.patch +++ b/cloud-init-no-openstack-guess.patch @@ -1,5 +1,14 @@ --- tools/ds-identify.orig +++ tools/ds-identify +@@ -95,7 +95,7 @@ DI_MAIN=${DI_MAIN:-main} + DI_BLKID_EXPORT_OUT="" + DI_GEOM_LABEL_STATUS_OUT="" + DI_DEFAULT_POLICY="search,found=all,maybe=all,notfound=${DI_DISABLED}" +-DI_DEFAULT_POLICY_NO_DMI="search,found=all,maybe=all,notfound=${DI_ENABLED}" ++DI_DEFAULT_POLICY_NO_DMI="search,found=all,maybe=all,notfound=${DI_DISABLED}" + DI_DMI_BOARD_NAME="" + DI_DMI_CHASSIS_ASSET_TAG="" + DI_DMI_PRODUCT_NAME="" @@ -1261,12 +1261,6 @@ dscheck_OpenStack() { return ${DS_FOUND} fi diff --git a/cloud-init.changes b/cloud-init.changes index da23544..42f8f3f 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Apr 9 16:00:13 UTC 2024 - Robert Schweikert + +- Update cloud-init-no-openstack-guess.patch + + Do not enable cloud-init on systems where there is no DMI just + because no data source has been found. No data source means + cloud-init will not run. + ------------------------------------------------------------------- Fri Apr 5 18:01:39 UTC 2024 - Robert Schweikert