public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/WALinuxAgent] f45: Fix Fedora's restart_if implementation
Date: Wed, 14 Oct 2026 13:17:33 GMT	[thread overview]
Message-ID: <179198385387.1.6088231615087757465.rpms-WALinuxAgent-c152b8f648d8@fedoraproject.org> (raw)

            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
 

                 reply	other threads:[~2026-10-14 13:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179198385387.1.6088231615087757465.rpms-WALinuxAgent-c152b8f648d8@fedoraproject.org \
    --to=vkuznets@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox