Skip to content
Snippets Groups Projects
Commit 3fced135 authored by Matthew McGill's avatar Matthew McGill
Browse files

thanos integration

Former-commit-id: 1bb613c9fd782df42ad8202f82afb75b921f94c8
parent dd932837
No related branches found
No related tags found
No related merge requests found
...@@ -543,24 +543,36 @@ perform_step() ...@@ -543,24 +543,36 @@ perform_step()
echo -n Performing step "$step" [dependencies=$mandatory] ... echo -n Performing step "$step" [dependencies=$mandatory] ...
starttime=`$PS_DATE` starttime=`$PS_DATE`
# If verbose is on, tee to a file # First, check if using Transform_Step plugin architecture
if [ ! -z "$DEBUG_STEPS" ]; then echo "$command"|grep "lib$step\.so " > /dev/null
$command grep_res=$?
command_exit=$? if [ $grep_res -eq 0 ] ; then
elif [ ! -z "$VERBOSE" ]; then if [[ "$(stop_if_error $step)" != "0" ]]; then
$command 2>&1 | tee $logfile echo "EXECUTE_STEP CRITICAL $command" > $input_pipe
command_exit=${PIPESTATUS[0]} # this funkiness gets the exit code of $command, not tee else
else echo "EXECUTE_STEP OPTIONAL $command" > $input_pipe
echo "$command"|grep "lib$step\.so " > /dev/null fi
grep_res=$?
if [ $grep_res -eq 0 ] ; then read -r thanos_res < $output_pipe
if [[ "$(stop_if_error $step)" != "0" ]]; then
echo "EXECUTE_STEP CRITICAL $command" > $input_pipe if [ "$thanos_res" = "ERR_INVALID_CMD" ]; then
else echo Internal Transform_Step plugin architecture error.
echo "EXECUTE_STEP OPTIONAL $command" > $input_pipe echo Exiting ps_analyze early.
fi exit -1
read -r thanos_res < $output_pipe elif [ "$thanos_res" = "STEP_UNSUPPORTED" ]; then
echo "Response was $thanos_res" command_exit=127 # command not found
else
command_exit=$thanos_res
fi
else
# Otherwise, do things the old way (step is its own process)
# If verbose is on, tee to a file
if [ ! -z "$DEBUG_STEPS" ]; then
$command
command_exit=$?
elif [ ! -z "$VERBOSE" ]; then
$command 2>&1 | tee $logfile
command_exit=${PIPESTATUS[0]} # this funkiness gets the exit code of $command, not tee
else else
$command > $logfile 2>&1 $command > $logfile 2>&1
command_exit=$? command_exit=$?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment