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