use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmReconfigureNginxRequest in project cloudbreak by hortonworks.
the class ReconfigureNginxHandlerTest method orchestrationException.
@Test
void orchestrationException() throws CloudbreakOrchestratorException {
UpgradeCcmReconfigureNginxRequest request = new UpgradeCcmReconfigureNginxRequest(STACK_ID, CLUSTER_ID, Tunnel.CCM);
when(event.getData()).thenReturn(request);
doThrow(new CloudbreakOrchestratorFailedException("salt error")).when(upgradeCcmService).reconfigureNginx(any());
Selectable result = underTest.doAccept(event);
verify(upgradeCcmService).reconfigureNginx(STACK_ID);
assertThat(result.selector()).isEqualTo("UPGRADECCMFAILEDEVENT");
}
use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmReconfigureNginxRequest in project cloudbreak by hortonworks.
the class ReconfigureNginxHandlerTest method doAccept.
@Test
void doAccept() throws CloudbreakOrchestratorException {
UpgradeCcmReconfigureNginxRequest request = new UpgradeCcmReconfigureNginxRequest(STACK_ID, CLUSTER_ID, Tunnel.CCM);
when(event.getData()).thenReturn(request);
Selectable result = underTest.doAccept(event);
verify(upgradeCcmService).reconfigureNginx(STACK_ID);
assertThat(result.selector()).isEqualTo("UPGRADECCMRECONFIGURENGINXRESULT");
}
use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmReconfigureNginxRequest in project cloudbreak by hortonworks.
the class ReconfigureNginxHandler method doAccept.
@Override
public Selectable doAccept(HandlerEvent<UpgradeCcmReconfigureNginxRequest> event) {
UpgradeCcmReconfigureNginxRequest request = event.getData();
Long stackId = request.getResourceId();
LOGGER.info("NGINX reconfiguration is needed for previous CCM tunnel type");
try {
upgradeCcmService.reconfigureNginx(stackId);
} catch (CloudbreakOrchestratorException e) {
LOGGER.debug("Failed reconfiguring NGINX with salt state");
return new UpgradeCcmFailedEvent(stackId, request.getOldTunnel(), e);
}
return new UpgradeCcmReconfigureNginxResult(stackId, request.getClusterId(), request.getOldTunnel());
}
Aggregations