From c9dc72d3d43f53fd17667f0ac32250285116f93a486dab4b25069b769603eb8f Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Fri, 5 Apr 2024 18:16:25 +0000 Subject: [PATCH] - 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)