From 2d55d485a81efbb5a541d8f572aa328ca13514763670be8671b338397b6bdcca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 3 Oct 2024 17:05:42 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main cloud-init revision dc15008f09290d59dde42ae852b7cd2b --- cloud-init-skip-rename.patch | 24 ++++++++++++++++++++++++ cloud-init.changes | 11 +++++++++++ cloud-init.spec | 7 +++++-- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 cloud-init-skip-rename.patch diff --git a/cloud-init-skip-rename.patch b/cloud-init-skip-rename.patch new file mode 100644 index 0000000..5e81987 --- /dev/null +++ b/cloud-init-skip-rename.patch @@ -0,0 +1,24 @@ +--- cloudinit/net/__init__.py.orig ++++ cloudinit/net/__init__.py +@@ -7,6 +7,7 @@ + + import errno + import functools ++import glob + import ipaddress + import logging + import os +@@ -702,6 +703,13 @@ def _rename_interfaces( + LOG.debug("no interfaces to rename") + return + ++ net_devs = glob.glob('/sys/class/net/*') ++ for dev in net_devs: ++ dev_name = dev.split('/')[-1] ++ for dev_data in renames: ++ if dev_name in dev_data: ++ del renames[renames.index(dev_data)] ++ + if current_info is None: + current_info = _get_current_rename_info() + diff --git a/cloud-init.changes b/cloud-init.changes index aa37276..75764dd 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Jun 14 10:34:54 UTC 2024 - Markéta Machová + +- remove dependency on /usr/bin/python3 via using the macros (bsc#1212476) + +------------------------------------------------------------------- +Mon Jun 3 19:53:46 UTC 2024 - Robert Schweikert + +- Add cloud-init-skip-rename.patch (bsc#1219680) + + Brute force appraoch to skip renames if the device is already present + ------------------------------------------------------------------- Mon Apr 29 21:49:48 UTC 2024 - Robert Schweikert diff --git a/cloud-init.spec b/cloud-init.spec index 13cf838..c5d9e7e 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -51,6 +51,8 @@ Patch12: cloud-init-no-openstack-guess.patch Patch13: cloud-init-no-nmcfg-needed.patch # FIXME https://github.com/canonical/cloud-init/pull/5161 Patch14: cloud-init-usr-sudoers.patch +# FIXME https://github.com/canonical/cloud-init/issues/5075 +Patch15: cloud-init-skip-rename.patch BuildRequires: fdupes BuildRequires: filesystem # pkg-config is needed to find correct systemd unit dir @@ -163,6 +165,7 @@ Documentation and examples for cloud-init tools %patch -P 12 %patch -P 13 %patch -P 14 +%patch -P 15 # patch in the full version to version.py version_pys=$(find . -name version.py -type f) @@ -171,14 +174,14 @@ version_pys=$(find . -name version.py -type f) sed -i "s,@@PACKAGED_VERSION@@,%{version}-%{release}," $version_pys %build -python3 setup.py build +%python3_build %check make unittest make lint %install -python3 setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python3_sitelib} --init-system=%{initsys} --distro=suse +%python3_install --init-system=%{initsys} --distro=suse find %{buildroot} \( -name .gitignore -o -name .placeholder \) -delete # from debian install script for x in "%{buildroot}%{_bindir}/"*.py; do