Blame 0017-refactor-ifcfg-delete-code-duplication-using-iface_g.patch

218d2d
From b6913f66b6c9e9ea81fd0832405c170876bc993a Mon Sep 17 00:00:00 2001
218d2d
From: Steffen Maier <maier@linux.ibm.com>
218d2d
Date: Wed, 26 Jul 2023 12:42:03 +0200
218d2d
Subject: [PATCH 17/23] refactor(ifcfg): delete code duplication using
218d2d
 iface_get_subchannels()
218d2d
218d2d
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
218d2d
---
218d2d
 modules.d/45ifcfg/write-ifcfg.sh | 10 ++--------
218d2d
 1 file changed, 2 insertions(+), 8 deletions(-)
218d2d
218d2d
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
218d2d
index 5550cce3..4ca96e98 100755
218d2d
--- a/modules.d/45ifcfg/write-ifcfg.sh
218d2d
+++ b/modules.d/45ifcfg/write-ifcfg.sh
218d2d
@@ -31,19 +31,13 @@ print_s390() {
218d2d
     local NETTYPE
218d2d
     local CONFIG_LINE
218d2d
     local i
218d2d
-    local channel
218d2d
     local OLD_IFS
218d2d
 
218d2d
     _netif="$1"
218d2d
     # if we find ccw channel, then use those, instead of
218d2d
     # of the MAC
218d2d
-    SUBCHANNELS=$({
218d2d
-        for i in /sys/class/net/"$_netif"/device/cdev[0-9]*; do
218d2d
-            [ -e "$i" ] || continue
218d2d
-            channel=$(readlink -f "$i")
218d2d
-            printf '%s' "${channel##*/},"
218d2d
-        done
218d2d
-    })
218d2d
+    # [iface_get_subchannels() from /lib/net-lib.sh sourced at top of this file]
218d2d
+    SUBCHANNELS=$(iface_get_subchannels "$_netif")
218d2d
     [ -n "$SUBCHANNELS" ] || return 1
218d2d
 
218d2d
     SUBCHANNELS=${SUBCHANNELS%,}
218d2d
-- 
218d2d
2.42.0
218d2d