summaryrefslogtreecommitdiffstats
path: root/gearman/controllerWorker/ControllerWorker/Boot.java
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-16 13:24:36 +0200
committerBjörn Geiger2011-08-16 13:24:36 +0200
commit0fca47d0e9c16537090ac2b0d35bace00d06bfcc (patch)
tree9a4a9a47002c4bc72e6a4c352fae8c66d3822f4b /gearman/controllerWorker/ControllerWorker/Boot.java
parentkleine Korrektur (diff)
downloadpoolctrl-0fca47d0e9c16537090ac2b0d35bace00d06bfcc.tar.gz
poolctrl-0fca47d0e9c16537090ac2b0d35bace00d06bfcc.tar.xz
poolctrl-0fca47d0e9c16537090ac2b0d35bace00d06bfcc.zip
verschiedene Korrekturen
Diffstat (limited to 'gearman/controllerWorker/ControllerWorker/Boot.java')
-rw-r--r--gearman/controllerWorker/ControllerWorker/Boot.java36
1 files changed, 21 insertions, 15 deletions
diff --git a/gearman/controllerWorker/ControllerWorker/Boot.java b/gearman/controllerWorker/ControllerWorker/Boot.java
index db286f8..3e76d93 100644
--- a/gearman/controllerWorker/ControllerWorker/Boot.java
+++ b/gearman/controllerWorker/ControllerWorker/Boot.java
@@ -440,21 +440,27 @@ public class Boot extends Thread {
GearmanJobResult wolJobRes = restartJob.get();
String result = ByteUtils.fromUTF8Bytes(wolJobRes
.getResults());
- System.out.println(result.toString());
- if (result.equals("")) {
- System.out.println(ipAddress
- + " Restart command send");
- status.put(clientID, 15); // restart command send
- restartJobs.remove(clientID);
- } else {
- System.out.println(ipAddress
- + " Cannot send restart command");
- this.errors
- .put(clientID,
- "Sending the restart command has been failed.");
- // cannot send restart command, go in errorState
- status.put(clientID, 19);
- restartJobs.remove(clientID);
+ if (result != "") {
+ JSONObject resultObj = (JSONObject) JSONValue
+ .parse(result);
+ String rawoutput = resultObj.get("rawoutput")
+ .toString();
+ if (rawoutput.equals("")) {
+ System.out.println(ipAddress
+ + " Restart command send");
+ status.put(clientID, 15); // restart command
+ // send
+ restartJobs.remove(clientID);
+ } else {
+ System.out.println(ipAddress
+ + " Cannot send restart command");
+ this.errors
+ .put(clientID,
+ "Sending the restart command has been failed.");
+ // cannot send restart command, go in errorState
+ status.put(clientID, 19);
+ restartJobs.remove(clientID);
+ }
}
}
}