Fix some error messages
authorNikos Skalkotos <skalkoto@grnet.gr>
Mon, 16 Jul 2012 11:53:52 +0000 (14:53 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Mon, 16 Jul 2012 11:53:52 +0000 (14:53 +0300)
snf-image-host/common.sh.in
snf-image-host/create
snf-image-host/helper-monitor.py

index 60db809..9f2b802 100644 (file)
@@ -27,7 +27,7 @@ CURL="curl"
 
 network_backend_support="@network_backend_support@"
 
-MSG_TYPE_ERROR="error"
+MSG_TYPE_ERROR="image-error"
 
 CLEANUP=( )
 ERROR_MSGS=( )
index 4af0729..63540f3 100755 (executable)
@@ -166,16 +166,17 @@ rc=$?
 set -e
 if [ $rc -ne 0 ]; then
     if [ $rc -eq 124 ];  then
-        log_error "Helper VM was terminated. Did not finish on time."
+        log_error "Image customization was terminated. Did not finish on time."
     elif [ $rc -eq 137 ]; then # (128 + SIGKILL)
-        log_error "Helper VM was killed. Did not finish on time."
+        log_error "Image customization was killed. Did not finish on time."
     elif [ $rc -eq 141 ]; then # (128 + SIGPIPE)
-        log_error "Helper was killed by a SIGPIPE signal."
+        log_error "Image customization was terminated by a SIGPIPE."
         log_error "Maybe progress monitor has died unexpectedly."
     elif [ $rc -eq 125 ]; then
+        log_error "Internal Error. Image customization could not start."
         log_error "timeout did not manage to run."
     else
-        log_error "KVM returned an error (return code $rc)."
+        log_error "Image customization died unexpectedly (return code $rc)."
     fi
     exit 1
 else
@@ -186,7 +187,7 @@ fi
 result=$(sed 's|\r||g' "$result_file" | head -1)
 
 if [ "x$result" != "xSUCCESS" ]; then
-    log_error "Helper VM did not return SUCCESS"
+    log_error "Image customization failed."
     exit 1
 fi
 
index 52913ab..151075d 100755 (executable)
@@ -37,7 +37,7 @@ PROTOCOL = {
 
 
 def error(msg):
-    sys.stderr.write("helper-monitor error: %s\n" % msg)
+    sys.stderr.write("HELPER-MONITOR ERROR: %s\n" % msg)
     sys.exit(1)
 
 
@@ -45,7 +45,7 @@ def send(fd, msg_type, value):
     subtype, value_name = PROTOCOL[msg_type]
 
     msg = {}
-    msg['type'] = 'helper'
+    msg['type'] = 'image-helper'
     msg['subtype'] = subtype
     msg[value_name] = value
     msg['timestamp'] = time.time()