This commit is contained in:
Nunzio Andrea Galante 2017-07-25 13:51:25 +00:00
parent 7ae4467d2d
commit 8a35a0c831
2 changed files with 19 additions and 3 deletions

View File

@ -45,9 +45,11 @@ public class ProductionPublishingJob extends DMPMJob ***REMOVED***
this.svnUpdater.updateSVNProdAlgorithmList(this.algorithm, this.targetVREName, this.algorithm.getFullname(), "Prod"); this.svnUpdater.updateSVNProdAlgorithmList(this.algorithm, this.targetVREName, this.algorithm.getFullname(), "Prod");
this.getStatus(9); this.getStatus(9);
sm.sendNotification(nh.getSuccessSubjectRelease() + " for "+this.algorithm.getName()+ " algorithm", nh.getSuccessBodyRelease(this.buildInfo())); sm.sendNotification(nh.getSuccessSubjectRelease() + " for "+this.algorithm.getName()+ " algorithm", nh.getSuccessBodyRelease(this.buildInfo()));
return;
***REMOVED*** ***REMOVED***
else this.getStatus(0);
sm.sendNotification(nh.getFailedSubjectRelease() + " for "+this.algorithm.getName()+ " algorithm", nh.getFailedBodyRelease(this.buildInfo()+" The user "+this.algorithm.getFullname()+ " is not authorized to access to the "+ targetVREName+ " VRE"));
return;
***REMOVED*** int ret = this.executeAnsibleWorker( ***REMOVED*** int ret = this.executeAnsibleWorker(
***REMOVED*** createWorker(this.algorithm, this.prodCluster, false, "gcube")); ***REMOVED*** createWorker(this.algorithm, this.prodCluster, false, "gcube"));
@ -59,7 +61,7 @@ public class ProductionPublishingJob extends DMPMJob ***REMOVED***
public String getStatus(int exitstatus) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED*** public String getStatus(int exitstatus) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED***
File m = new File(this.jobLogs + File.separator + this.id); 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");
String response = ""; String response = "";
@ -68,6 +70,14 @@ public class ProductionPublishingJob extends DMPMJob ***REMOVED***
response = "SVN REPOSITORY CORRECTLY UPDATED; THE CRON JOB WILL INSTALL THE ALGORITHM "+ this.algorithm.getName() + " IN THE VRE" + targetVREName; response = "SVN REPOSITORY CORRECTLY UPDATED; THE CRON JOB WILL INSTALL THE ALGORITHM "+ this.algorithm.getName() + " IN THE VRE" + targetVREName;
writer.println(response); writer.println(response);
***REMOVED*** ***REMOVED***
if (exitstatus == 0) ***REMOVED***
response = "SVN REPOSITORY UPDATE FAI; THE CRON JOB WILL NOT BE ABLE TO INSTALL THE ALGORITHM "+this.algorithm.getName()+" IN THE VRE" + targetVREName;;
writer.println(response);
***REMOVED***writer.close();
***REMOVED***
writer.close(); writer.close();
return response; return response;
***REMOVED*** ***REMOVED***

View File

@ -66,6 +66,12 @@ public class NotificationHelper ***REMOVED***
return message; return message;
***REMOVED*** ***REMOVED***
public String getFailedBodyRelease(String info) ***REMOVED***
String message = String.format("SVN REPOSITORY UPDATE FAILED.");
message+="\n\n The CRON job will NOT be able to install the algorithm in the target VRE \n\n"+ info;
return message;
***REMOVED***
***REMOVED*** public String getSubject() ***REMOVED*** ***REMOVED*** public String getSubject() ***REMOVED***
***REMOVED*** if(this.isError()) ***REMOVED*** ***REMOVED*** if(this.isError()) ***REMOVED***
***REMOVED*** return this.getFailedSubject(); ***REMOVED*** return this.getFailedSubject();