From ed129bcf1fb836ff89302d2a4b45a8c078304d8b Mon Sep 17 00:00:00 2001 From: William Wernert Date: Fri, 15 Jan 2021 09:25:04 -0500 Subject: [PATCH] [fix] Add verbose flag so that so-monitor-add only sees necessary information --- salt/common/tools/sbin/so-common | 21 ++++++++++++++++++--- setup/so-functions | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/salt/common/tools/sbin/so-common b/salt/common/tools/sbin/so-common index 4b722f57e..d73ec18f2 100755 --- a/salt/common/tools/sbin/so-common +++ b/salt/common/tools/sbin/so-common @@ -41,8 +41,18 @@ add_interface_bond0() { fi done + case "$2" in + -v|--verbose) + local verbose=true + ;; + esac + for i in rx tx sg tso ufo gso gro lro; do - ethtool -K "$BNIC" $i off + if [[ $verbose != true ]]; then + ethtool -K "$BNIC" $i off + else + ethtool -K "$BNIC" $i off &>/dev/null + fi done # Check if the bond slave connection has already been created nmcli -f name,uuid -p con | grep -q "bond0-slave-$BNIC" @@ -64,8 +74,13 @@ add_interface_bond0() { ip link set dev "$BNIC" arp off multicast off allmulticast off promisc on - nmcli con up "bond0-slave-$BNIC" # Bring the slave interface up - + # Bring the slave interface up + if [[ $verbose != true ]]; then + nmcli con up "bond0-slave-$BNIC" + else + nmcli con up "bond0-slave-$BNIC" &>/dev/null + fi + if [ "$nic_error" != 0 ]; then return "$nic_error" fi diff --git a/setup/so-functions b/setup/so-functions index f06bbd9e0..132d6d202 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -884,7 +884,7 @@ configure_network_sensor() { local err=0 for BNIC in "${BNICS[@]}"; do - add_interface_bond0 "$BNIC" >> "$setup_log" 2>&1 + add_interface_bond0 "$BNIC" --verbose >> "$setup_log" 2>&1 local ret=$? [[ $ret -eq 0 ]] || err=$ret done