From cdb6dfcea0c677b3e23f527bda7b84c11f0b7436 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Mon, 28 Dec 2020 14:55:15 -0500 Subject: [PATCH] [fix][wip] Fix whiptail output --- salt/common/tools/sbin/so-common | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/salt/common/tools/sbin/so-common b/salt/common/tools/sbin/so-common index 4543ad9fb..6cefb11dc 100755 --- a/salt/common/tools/sbin/so-common +++ b/salt/common/tools/sbin/so-common @@ -157,10 +157,10 @@ wait_for_apt() { local count=0 while [[ "$count" -lt "$retry_count" ]]; do ((count++)) - echo "Attempting to acquire dpkg lock to run apt command... (Attempt $count/$retry_count)" + [[ -z $progress_callback ]] && echo "Attempting to acquire dpkg lock to run apt command... (Attempt $count/$retry_count)" if __check_apt_lock; then if [[ -z $progress_callback ]]; then - echo " $lock_msg" + echo " $lock_msg" | tee -a "$setup_log" else $progress_callback "$lock_msg (Attempt $count/$retry_count)" fi @@ -172,9 +172,7 @@ wait_for_apt() { done if __check_apt_lock; then - if [[ -z $progress_callback ]]; then - echo "Could not acquire lock after $retry_count attempts, aborting." - fi + [[ -z $progress_callback ]] && echo "Could not acquire lock after $retry_count attempts, aborting." return 1 else return 0