local STATUS=$(xmllint --xpath "/*/*/*[local-name()='status']/text()"$TMPFILE)|| (echo "Couldn't extract status from file:"; cat $TMPFILE; rm $TMPFILE;return 1)
if [ $STATUS="success" ];then
rm $TMPFILE
return 0
else
echo"Bulk action status is not OK: $STATUS"
local CONSOLE_OUTPUT=$(xmllint --xpath "/*/*/*[local-name()='consoleOutput']/text()"$TMPFILE)|| (echo "Couldn't extract console output from file:"; cat $TMPFILE; rm $TMPFILE;return 1)
echo"Console output: $CONSOLE_OUTPUT"
rm $TMPFILE
return 1
fi
else
echo"Error code: $HTTP_CODE"
if [ "$http_code"-eq 500 ];then
echo"Error message: Internal server error. Unexpected error occurred, if necessary please contact system administrator."
fi
return 1
fi
}
# Tries to find an object with a given name
# Results of the search are in the $SEARCH_RESULT_FILE
# TODO check if the result is valid (i.e. not an error) - return 1 if invalid, otherwise return 0 ("no objects" is considered OK here)