potiuk commented on a change in pull request #16503:
URL: https://github.com/apache/airflow/pull/16503#discussion_r655422594



##########
File path: scripts/ci/libraries/_traps.sh
##########
@@ -31,8 +31,17 @@ function traps::add_trap() {
     do
         # adding trap to exiting trap
         local handlers
-        handlers="$( trap -p "${signal}" | cut -f2 -d \' )"
+        # shellcheck disable=SC2046
+        handlers="$(_parse_current_traps "${signal}")"
         # shellcheck disable=SC2064
         trap "${trap};${handlers}" "${signal}"
     done
 }
+
+function _parse_current_traps() {
+  local signal="$1"
+  # Yes, eval is evil, but this is the only way I was able to "parse" the 
output of trap which is "already" quoted
+  eval "set -- $(trap -p "$signal")"

Review comment:
       Yeah. It is insane. I agree. 
   
   Indeed I forgot about cleaning the volume in CI when we separated  it out 
(it's implemented in Breeze). Would be worth checking if test failure results 
with exit != 0. I hope it will fail randomly so we would know ;)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to