From b7a2a5c16a652e530eb59173780978541a9a7313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez?= Date: Tue, 20 Apr 2021 13:21:26 +0200 Subject: [PATCH] B #: fix minor bug at fs/cp & BRIDGE_LIST (#1117) (cherry picked from commit 02416dcb00ea42be4d22583bdc876a805ef87049) --- src/datastore_mad/remotes/fs/cp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/datastore_mad/remotes/fs/cp b/src/datastore_mad/remotes/fs/cp index 828a35c7a6..d66389528e 100755 --- a/src/datastore_mad/remotes/fs/cp +++ b/src/datastore_mad/remotes/fs/cp @@ -153,7 +153,13 @@ if [ -n "$BRIDGE_LIST" ]; then "Error converting $DST in $DST_HOST" fi - FORMAT=$(ssh_monitor_and_log $DST_HOST "$QEMU_IMG info $DST | grep "^file format:" | awk '{print \$3}' || :" 2>&1) + FORMAT=$(ssh_monitor_and_log $DST_HOST "set -e -o pipefail; $QEMU_IMG info $DST | grep \"^file format:\" | awk '{print \$3}'") + + # if ssh_monitor_and_log fails RC is returned + if [[ $FORMAT =~ '^[0-9]+$' ]]; then + exit -1 + fi + else mkdir -p "$BASE_PATH" multiline_exec_and_log "set -e -o pipefail; $COPY_COMMAND" "Error copying $SRC to $DST"