Sync from SUSE:ALP:Source:Standard:1.0 cloud-init revision 91577b9c4b37a4b158e172688fada975

This commit is contained in:
Adrian Schröter 2024-06-28 14:56:54 +02:00
parent f36e7c619f
commit 9a2b111695
3 changed files with 33 additions and 0 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,9 @@
-------------------------------------------------------------------
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>

View File

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