33 lines
1.1 KiB
Diff
33 lines
1.1 KiB
Diff
commit 1cb8bd89d6386c60e75c47d4a4452d3f130d5138
|
|
Author: Mingming Cao <mmc@linux.vnet.ibm.com>
|
|
Date: Fri Mar 12 14:18:18 2021 -0800
|
|
|
|
hcnmgr: Avoid using xargs to process NM show connections
|
|
|
|
When removing HNV bonding connections xargs can fail to process the output of
|
|
nmcli show propererly.
|
|
|
|
Instead of piping into xargs fix this by using a loop to check for all related
|
|
bonding connections and remove them explicitly one by one.
|
|
|
|
Signed-off-by: Mingming Cao <mmc@linux.vnet.ibm.com>
|
|
[tyreld: fixed up commit log]
|
|
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
|
|
|
|
diff --git a/scripts/hcnmgr b/scripts/hcnmgr
|
|
index d66b5d1..30d31e7 100644
|
|
--- a/scripts/hcnmgr
|
|
+++ b/scripts/hcnmgr
|
|
@@ -377,7 +377,10 @@ rmhcn() {
|
|
fi
|
|
|
|
hcnlog INFO "rmhcn: delete bond $BONDNAME and slaves "
|
|
- nmcli -f NAME con show | grep "$BONDNAME" | xargs sudo nmcli con delete
|
|
+ for connection in $(nmcli -f NAME con show | grep "$BONDNAME"); do
|
|
+ hcnlog INFO "Delete bonding connection $connection"
|
|
+ nmcli con delete "$connection"
|
|
+ done
|
|
hcnlog DEBUG "rmhcn: exit"
|
|
return $E_SUCCESS
|
|
}
|