Commit 3e8f03c5 authored by Roque's avatar Roque

Error message removed for no-error scenarios

parent b6c537b3
...@@ -10,6 +10,7 @@ DATASET_REPORT_FILE_NAME="/.dataset-task-report" ...@@ -10,6 +10,7 @@ DATASET_REPORT_FILE_NAME="/.dataset-task-report"
DATASET_COMPLETE_FILE_NAME="/.dataset-completed" DATASET_COMPLETE_FILE_NAME="/.dataset-completed"
DISCARD_CHANGES_FILE_NAME="/.discard-changes" DISCARD_CHANGES_FILE_NAME="/.discard-changes"
LOG_DIR="$EBULK_DATA_PATH/logs" LOG_DIR="$EBULK_DATA_PATH/logs"
STATUS_FILE="$EBULK_DATA_PATH/.status"
CREDENTIALS_FILE="$EBULK_DATA_PATH/.credentials" CREDENTIALS_FILE="$EBULK_DATA_PATH/.credentials"
CONFIG_FILE="$EBULK_DATA_PATH/.config" CONFIG_FILE="$EBULK_DATA_PATH/.config"
DESCRIPTION_DATASET_PATH_PREFIX="$EBULK_DATA_PATH/.dataset-description" DESCRIPTION_DATASET_PATH_PREFIX="$EBULK_DATA_PATH/.dataset-description"
...@@ -300,6 +301,7 @@ function runProcess { ...@@ -300,6 +301,7 @@ function runProcess {
fi fi
$embulk run -I $TOOL_PATH/embulk-wendelin-dataset-tool/lib $FILE $DIFF_COMMAND 2> "$LOG_DIR/error.log" || { $embulk run -I $TOOL_PATH/embulk-wendelin-dataset-tool/lib $FILE $DIFF_COMMAND 2> "$LOG_DIR/error.log" || {
if [ "$STATUS" == \"\" ] ; then if [ "$STATUS" == \"\" ] ; then
if [ ! -f $STATUS_FILE ]; then
if [ "$DATASET_DESCRIPTION" == "" ] ; then if [ "$DATASET_DESCRIPTION" == "" ] ; then
echo echo
echo -e "${ORANGE}[ERROR] Embulk tool stopped its execution.${NC}" echo -e "${ORANGE}[ERROR] Embulk tool stopped its execution.${NC}"
...@@ -310,13 +312,14 @@ function runProcess { ...@@ -310,13 +312,14 @@ function runProcess {
echo "[INFO] Please check the logs in '$LOG_DIR' directory for more details." echo "[INFO] Please check the logs in '$LOG_DIR' directory for more details."
echo echo
fi fi
fi
fi fi
} }
} }
function javaNotInstalled { function javaNotInstalled {
echo -e "${ORANGE}[ERROR] java 8 must be installed. Please, install java 8 and try again.${NC}" echo -e "${ORANGE}[ERROR] java 8 must be installed. Please, install java 8 and try again.${NC}"
echo "[INFO] You can download the installation package for your operative system clicking on the Download button on https://java.com/en/" echo "[INFO] You can download the installation package for your operative system clicking on the Download button on https://java.com/en/"
echo "[INFO] Please follow the instructions to install java 8 here https://java.com/en/download/help/download_options.xml" echo "[INFO] Please follow the instructions to install java 8 here https://java.com/en/download/help/download_options.xml"
echo echo
} }
......
...@@ -7,15 +7,20 @@ class LogManager ...@@ -7,15 +7,20 @@ class LogManager
INFO = "INFO" INFO = "INFO"
ERROR = "ERROR" ERROR = "ERROR"
WARN = "WARNING" WARN = "WARNING"
STATUS_FILE = ".status"
def initialize() def initialize()
now = Time.now.strftime("%d-%m-%Y") now = Time.now.strftime("%d-%m-%Y")
@filename = "#{now.to_s}.log" @filename = "#{now.to_s}.log"
@user @user
@password @password
@status_file = "./"
File.delete(@status_file + STATUS_FILE) if File.exist?(@status_file + STATUS_FILE)
end end
def setFilename(tool_dir, prefix) def setFilename(tool_dir, prefix)
@status_file = tool_dir + "/"
File.delete(@status_file + STATUS_FILE) if File.exist?(@status_file + STATUS_FILE)
log_dir = "#{tool_dir}/logs/" log_dir = "#{tool_dir}/logs/"
if not File.directory?(log_dir) if not File.directory?(log_dir)
Dir.mkdir log_dir Dir.mkdir log_dir
...@@ -55,9 +60,11 @@ class LogManager ...@@ -55,9 +60,11 @@ class LogManager
puts puts
unless @path.nil? unless @path.nil?
puts "PROCESS ABORTED : For more detailed information, please refer to the log file '#{@path}'" puts "PROCESS ABORTED : For more detailed information, please refer to the log file '#{@path}'"
exec("Process.kill 9, Process.pid >/dev/null 2>&1")
end end
end end
exec("Process.kill 9, Process.pid >/dev/null 2>&1") File.open(@status_file + STATUS_FILE, 'w')
exit!
end end
def logOutOfMemoryError(reference) def logOutOfMemoryError(reference)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment