6edea0
From 07e7e84ebea1d76aeaa77d097b34503ec3c8f2e1 Mon Sep 17 00:00:00 2001
6edea0
From: Lubomir Rintel <lkundrak@v3.sk>
6edea0
Date: Wed, 30 Oct 2019 19:25:51 +0100
6edea0
Subject: [PATCH] network-manager: fix getting of ifname from the sysfs path
6edea0
6edea0
commit 5e0f8c8a4ced ('network-manager: remove useless use of basename')
6edea0
somewhat carelessly didn't take into account that $_i has a slash at
6edea0
the end which made the result of the ## substitution be just an empty
6edea0
string.
6edea0
6edea0
The slash was put to the end of /sys/class/net/*/ to make sure we're only
6edea0
iterating directories, but it's not strictly necessary. In an unlikely case
6edea0
something else than a directory appears in /sys/class/net/, we'll already deal
6edea0
with it gracefully. Remove it.
6edea0
6edea0
This fixes the TEST-30-ISCSI test.
6edea0
6edea0
(cherry picked from commit 687e17aa7f2f40d21717be9a04302c749e139d4a)
6edea0
6edea0
Resolves: #1826061
6edea0
---
6edea0
 modules.d/35network-manager/nm-run.sh | 2 +-
6edea0
 1 file changed, 1 insertion(+), 1 deletion(-)
6edea0
6edea0
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
6edea0
index a539d5b2..b33e0992 100755
6edea0
--- a/modules.d/35network-manager/nm-run.sh
6edea0
+++ b/modules.d/35network-manager/nm-run.sh
6edea0
@@ -6,7 +6,7 @@ else
6edea0
     /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
6edea0
 fi
6edea0
 
6edea0
-for _i in /sys/class/net/*/
6edea0
+for _i in /sys/class/net/*
6edea0
 do
6edea0
     state=/run/NetworkManager/devices/$(cat $_i/ifindex)
6edea0
     grep -q connection-uuid= $state 2>/dev/null || continue
6edea0