use of com.sequenceiq.cloudbreak.orchestrator.salt.domain.RunningJobsResponse in project cloudbreak by hortonworks.
the class SaltStatesTest method testJobIsRunningReturnsExceptionOnNullResult.
@Test(expected = CloudbreakOrchestratorFailedException.class)
public void testJobIsRunningReturnsExceptionOnNullResult() throws CloudbreakOrchestratorFailedException {
RunningJobsResponse runningJobsResponse = new RunningJobsResponse();
when(saltConnector.run(eq("jobs.active"), any(), eq(RunningJobsResponse.class))).thenReturn(runningJobsResponse);
SaltStates.jobIsRunning(saltConnector, "1");
}
use of com.sequenceiq.cloudbreak.orchestrator.salt.domain.RunningJobsResponse in project cloudbreak by hortonworks.
the class SaltStates method getRunningJobs.
public static RunningJobsResponse getRunningJobs(SaltConnector sc) throws CloudbreakOrchestratorFailedException {
RunningJobsResponse runningInfo = sc.run("jobs.active", RUNNER, RunningJobsResponse.class);
LOGGER.debug("Active salt jobs: {}", runningInfo);
validateRunningInfoResultNotNull(runningInfo);
return runningInfo;
}
use of com.sequenceiq.cloudbreak.orchestrator.salt.domain.RunningJobsResponse in project cloudbreak by hortonworks.
the class SaltJobIdTracker method checkIsOtherJobRunning.
private void checkIsOtherJobRunning() throws CloudbreakOrchestratorFailedException, CloudbreakOrchestratorInProgressException {
RunningJobsResponse runningJobs = SaltStates.getRunningJobs(saltConnector);
List<String> runningJobIds = mapToRunningJobIds(runningJobs);
if (!runningJobIds.isEmpty()) {
LOGGER.warn("There are running job(s) with id: {}. Postpone starting the new job until these are finished.", runningJobIds);
throw new CloudbreakOrchestratorInProgressException("There are running job(s) with id: " + runningJobIds, saltJobRunner.getNodesWithError());
}
}
Aggregations