You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2020/06/09 09:04:30 UTC

[airflow] 17/36: Prevents failure on fixing permissions for files with space in it (#9076)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 4c6a82a1a9b156cf5b79e6b6044a1654e65f0a67
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Sat May 30 21:02:31 2020 +0200

    Prevents failure on fixing permissions for files with space in it (#9076)
    
    (cherry picked from commit 88c8edb898969c2bb6b9cbc04f504691c67c91ff)
---
 scripts/ci/in_container/_in_container_utils.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/scripts/ci/in_container/_in_container_utils.sh b/scripts/ci/in_container/_in_container_utils.sh
index b1de08b..be386e0 100644
--- a/scripts/ci/in_container/_in_container_utils.sh
+++ b/scripts/ci/in_container/_in_container_utils.sh
@@ -39,11 +39,19 @@ function in_container_script_end() {
     #shellcheck disable=2181
     EXIT_CODE=$?
     if [[ ${EXIT_CODE} != 0 ]]; then
+        if [[ -n ${OUT_FILE:=} ]]; then
+            echo "  ERROR ENCOUNTERED!"
+            echo
+            echo "  Output:"
+            echo
+            cat "${OUT_FILE}"
+            echo "###########################################################################################"
+        fi
         echo "###########################################################################################"
         echo "                   EXITING ${0} WITH STATUS CODE ${EXIT_CODE}"
         echo "###########################################################################################"
-
     fi
+
     if [[ ${VERBOSE_COMMANDS} == "true" ]]; then
         set +x
     fi
@@ -85,8 +93,8 @@ function in_container_cleanup_pycache() {
 #
 function in_container_fix_ownership() {
     set +o pipefail
-    sudo find . -user root \
-    | sudo xargs chown -v "${HOST_USER_ID}.${HOST_GROUP_ID}" --no-dereference >/dev/null 2>&1
+    sudo find . -user root -print0 \
+    | sudo xargs --null chown -v "${HOST_USER_ID}.${HOST_GROUP_ID}" --no-dereference >/dev/null 2>&1
     set -o pipefail
 }
 
@@ -254,7 +262,7 @@ function send_kubernetes_logs_to_file_io() {
 
 function install_released_airflow_version() {
     pip uninstall -y apache-airflow || true
-    find /root/airflow/ -type f -print0 | xargs rm -f --
+    find /root/airflow/ -type f -print0 | xargs -0 rm -f --
     if [[ ${1} == "1.10.2" || ${1} == "1.10.1" ]]; then
         export SLUGIFY_USES_TEXT_UNIDECODE=yes
     fi