Skip to content

Commit

Permalink
prevent payg-dimension-computation from beeing displayed and modified
Browse files Browse the repository at this point in the history
  • Loading branch information
mcalmer committed Aug 22, 2023
1 parent 97446e9 commit 8dd0ff0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public ActionForward execute(ActionMapping mapping,
public List<Map<String, Object>> getResult(RequestContext contextIn) {
User user = contextIn.getCurrentUser();
try {
return new TaskomaticApi().findActiveSchedules(user);
List<Map<String, Object>> activeSchedules = new TaskomaticApi().findActiveSchedules(user);
activeSchedules.removeIf(s -> s.get("job_label").equals("payg-dimension-computation-default"));
return activeSchedules;
}
catch (TaskomaticApiException e) {
createErrorMessage(contextIn.getRequest(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ private void setupForm(HttpServletRequest request, DynaActionForm form) {
TaskomaticApi tapi = new TaskomaticApi();
Map<String, Object> schedule = tapi.lookupScheduleById(loggedInUser, schid);
String scheduleName = (String) schedule.get("job_label");
if (scheduleName.equals("payg-dimension-computation-default")) {
// not modifiable
return;
}
String bunchName = (String) schedule.get("bunch");
request.setAttribute("schedulename", scheduleName);
form.set("schedulename", scheduleName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public String getConfigNamespace() {
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
if (!cloudManager.isPaygInstance()) {
LOGGER.debug("Not a PAYG instance. Exit");
return;
}

Expand Down

0 comments on commit 8dd0ff0

Please sign in to comment.