use of com.sequenceiq.freeipa.flow.stack.update.event.UserDataUpdateOnProviderResult in project cloudbreak by hortonworks.
the class UpdateUserDataOnProviderHandler method doAccept.
@Override
protected Selectable doAccept(HandlerEvent<UserDataUpdateOnProviderRequest> event) {
UserDataUpdateOnProviderRequest request = event.getData();
try {
LOGGER.info("Updating userData on cloud provider side...");
CloudConnector<?> connector = cloudPlatformConnectors.get(request.getCloudContext().getPlatformVariant());
AuthenticatedContext auth = connector.authentication().authenticate(request.getCloudContext(), request.getCloudCredential());
CloudStack stack = request.getCloudStack();
connector.resources().updateUserData(auth, stack, request.getCloudResources(), request.getUserData());
return new UserDataUpdateOnProviderResult(request.getResourceId());
} catch (Exception e) {
LOGGER.error("Updating user data on provider side has failed", e);
return new UserDataUpdateFailed(UPDATE_USERDATA_FAILED_EVENT.event(), request.getResourceId(), e);
}
}
Aggregations