Sync from SUSE:SLFO:Main cloud-init revision dc15008f09290d59dde42ae852b7cd2b

This commit is contained in:
Adrian Schröter 2024-10-03 17:05:42 +02:00
parent aac6763e4c
commit 2d55d485a8
3 changed files with 40 additions and 2 deletions

View File

@ -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()

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Fri Jun 14 10:34:54 UTC 2024 - Markéta Machová <mmachova@suse.com>
- remove dependency on /usr/bin/python3 via using the macros (bsc#1212476)
-------------------------------------------------------------------
Mon Jun 3 19:53:46 UTC 2024 - Robert Schweikert <rjschwei@suse.com>
- 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 <rjschwei@suse.com> Mon Apr 29 21:49:48 UTC 2024 - Robert Schweikert <rjschwei@suse.com>

View File

@ -51,6 +51,8 @@ Patch12: cloud-init-no-openstack-guess.patch
Patch13: cloud-init-no-nmcfg-needed.patch Patch13: cloud-init-no-nmcfg-needed.patch
# FIXME https://github.com/canonical/cloud-init/pull/5161 # FIXME https://github.com/canonical/cloud-init/pull/5161
Patch14: cloud-init-usr-sudoers.patch Patch14: cloud-init-usr-sudoers.patch
# FIXME https://github.com/canonical/cloud-init/issues/5075
Patch15: cloud-init-skip-rename.patch
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: filesystem BuildRequires: filesystem
# pkg-config is needed to find correct systemd unit dir # 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 12
%patch -P 13 %patch -P 13
%patch -P 14 %patch -P 14
%patch -P 15
# patch in the full version to version.py # patch in the full version to version.py
version_pys=$(find . -name version.py -type f) 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 sed -i "s,@@PACKAGED_VERSION@@,%{version}-%{release}," $version_pys
%build %build
python3 setup.py build %python3_build
%check %check
make unittest make unittest
make lint make lint
%install %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 find %{buildroot} \( -name .gitignore -o -name .placeholder \) -delete
# from debian install script # from debian install script
for x in "%{buildroot}%{_bindir}/"*.py; do for x in "%{buildroot}%{_bindir}/"*.py; do