public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/WALinuxAgent] f45: Fix Fedora's restart_if implementation
@ 2026-10-14 13:17 Vitaly Kuznetsov
0 siblings, 0 replies; only message in thread
From: Vitaly Kuznetsov @ 2026-10-14 13:17 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/WALinuxAgent
Branch : f45
Commit : c152b8f648d8c427c2297eaf9898b9593889a15d
Author : Vitaly Kuznetsov <vkuznets@redhat.com>
Date : 2026-10-14T15:17:11+02:00
Stats : +36/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/WALinuxAgent/c/c152b8f648d8c427c2297eaf9898b9593889a15d?branch=f45
Log:
Fix Fedora's restart_if implementation
WALinuxAgent reports an error restarting network interface upon
provisioning (when cloud-init is not available).
This is https://github.com/Azure/WALinuxAgent/pull/3706 upstream.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
diff --git a/0001-Unify-fedora-s-restart_if-defaults-with-RHEL-Ubuntu.patch b/0001-Unify-fedora-s-restart_if-defaults-with-RHEL-Ubuntu.patch
new file mode 100644
index 0000000..58734c3
--- /dev/null
+++ b/0001-Unify-fedora-s-restart_if-defaults-with-RHEL-Ubuntu.patch
@@ -0,0 +1,35 @@
+From d7120e58b6bbcec5deaaa228558fd25c9af8feec Mon Sep 17 00:00:00 2001
+From: Vitaly Kuznetsov <vkuznets@redhat.com>
+Date: Wed, 14 Oct 2026 14:25:12 +0200
+Subject: [PATCH] Unify fedora's restart_if defaults with RHEL/Ubuntu
+Content-Type: text/plain
+
+RHEL/Ubuntu implementations use reties=3, wait=5 and if we
+keep 'None' for the retries, restart_if fails with
+
+ File "/usr/lib/python3.15/site-packages/azurelinuxagent/common/osutil/fedora.py", line 46, in restart_if
+ retry_limit = retries+1
+ ~~~~~~~^~
+ TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
+
+Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
+---
+ azurelinuxagent/common/osutil/fedora.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/azurelinuxagent/common/osutil/fedora.py b/azurelinuxagent/common/osutil/fedora.py
+index 164b55ebf718..ac532a738e97 100644
+--- a/azurelinuxagent/common/osutil/fedora.py
++++ b/azurelinuxagent/common/osutil/fedora.py
+@@ -42,7 +42,7 @@ class FedoraOSUtil(DefaultOSUtil):
+ def start_network(self):
+ pass
+
+- def restart_if(self, ifname=None, retries=None, wait=None):
++ def restart_if(self, ifname=None, retries=3, wait=5):
+ retry_limit = retries+1
+ for attempt in range(1, retry_limit):
+ return_code = shellutil.run("ip link set {0} down && ip link set {0} up".format(ifname))
+--
+2.55.0
+
diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec
index df9980f..1e929c2 100644
--- a/WALinuxAgent.spec
+++ b/WALinuxAgent.spec
@@ -12,6 +12,7 @@ Source1: module-setup.sh
Patch1: 0001-waagent.service-set-ConditionVirtualization-microsof.patch
Patch2: 0001-Fedora-get-rid-of-passlib-dependency.patch
+Patch3: 0001-Unify-fedora-s-restart_if-defaults-with-RHEL-Ubuntu.patch
BuildArch: noarch
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-14 13:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 13:17 [rpms/WALinuxAgent] f45: Fix Fedora's restart_if implementation Vitaly Kuznetsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox