This commit is contained in:
Nunzio Andrea Galante 2017-07-18 13:22:29 +00:00
parent c55230a213
commit 23f461784b
1 changed files with 13 additions and 15 deletions

View File

@ -38,13 +38,12 @@ public class StagingJob extends DMPMJob {
this.stagingCluster = stagingCluster; this.stagingCluster = stagingCluster;
// this.rProtoCluster = rProtoCluster; // this.rProtoCluster = rProtoCluster;
this.rProtoVREName = rProtoVREName; this.rProtoVREName = rProtoVREName;
File m = new File(this.jobLogs + File.separator + this.id + "_exitStatus"); File m = new File(this.jobLogs + File.separator + this.id + "_exitStatus");
PrintWriter writer = new PrintWriter(m, "UTF-8"); PrintWriter writer = new PrintWriter(m, "UTF-8");
writer.println(this.getStatus(0)); writer.println(this.getStatus(0));
writer.close(); writer.close();
} }
@Override @Override
@ -73,16 +72,11 @@ public class StagingJob extends DMPMJob {
int ret = this.executeAnsibleWorker(createWorker(this.algorithm, this.stagingCluster, false, "root")); int ret = this.executeAnsibleWorker(createWorker(this.algorithm, this.stagingCluster, false, "root"));
// Integer s = null;
// s = Integer.valueOf(ret);
//
// if (s == null) {
// this.getStatus(0);
// }
if (ret != 0) { if (ret != 0) {
this.getStatus(2); this.getStatus(2);
sm.sendNotification(nh.getFailedSubject(), nh.getFailedBody("Installation failed. Return code=" + ret)); sm.sendNotification(nh.getFailedSubject(), nh.getFailedBody("Installation failed. Return code=" + ret));
return;
} }
if (ret == 0) { if (ret == 0) {
@ -90,21 +84,25 @@ public class StagingJob extends DMPMJob {
if (b.checkMethod(a.getStagingHost(), SecurityTokenProvider.instance.get()) if (b.checkMethod(a.getStagingHost(), SecurityTokenProvider.instance.get())
&& (b.algoExists(this.algorithm))) { && (b.algoExists(this.algorithm))) {
System.out.println("Interface check ok!"); System.out.println("Interface check ok!");
System.out.println("Both the files exist at the correct path!"); System.out.println("Both the files exist at the correct path!");
this.svnUpdater.updateSVNRProtoAlgorithmList(this.algorithm, this.rProtoVREName, this.svnUpdater.updateSVNRProtoAlgorithmList(this.algorithm, this.rProtoVREName,
this.algorithm.getFullname(), "Proto"); this.algorithm.getFullname(), "Proto");
this.getStatus(9); this.getStatus(9);
sm.sendNotification(nh.getSuccessSubject(), nh.getSuccessBody()); sm.sendNotification(nh.getSuccessSubject(), nh.getSuccessBody());
return;
} else } else
this.getStatus(2); this.getStatus(2);
sm.sendNotification(nh.getFailedSubject(), sm.sendNotification(nh.getFailedSubject(),
nh.getFailedBody("Installation completed but DataMiner Interface not working correctly or files " + this.algorithm.getName() nh.getFailedBody(
+ ".jar and " + this.algorithm.getName() "Installation completed but DataMiner Interface not working correctly or files "
+ "_interface.jar not availables at the expected path")); + this.algorithm.getName() + ".jar and " + this.algorithm.getName()
+ "_interface.jar not availables at the expected path"));
return;
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();