]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
utils: fix ssh_exec function 2117/head
authorIonut Balutoiu <ibalutoiu@cloudbasesolutions.com>
Fri, 17 Feb 2023 11:38:43 +0000 (13:38 +0200)
committerIonut Balutoiu <ibalutoiu@cloudbasesolutions.com>
Fri, 17 Feb 2023 11:38:43 +0000 (13:38 +0200)
We need to use `return` inside the function to properly return the
exit code of the function. Using `exit` will abruptly exit the
entire script, which is not what we want.

Signed-off-by: Ionut Balutoiu <ibalutoiu@cloudbasesolutions.com>
scripts/build_utils.sh

index d898a41396156a5ade5987bcfc69a3369502f316..cce078f9d36ce1f4ff33e938d4cb8452a4535b94 100755 (executable)
@@ -1690,7 +1690,7 @@ function ssh_exec() {
         if [[ $EXIT_CODE -eq 124 ]]; then
             echo "ERROR: ssh command timed out"
         fi
-        exit $EXIT_CODE
+        return $EXIT_CODE
     }
 }