Source:
public void createUserData(Long stackId) throws CloudbreakImageNotFoundException { Stack stack = stackService.getByIdWithLists(stackId); String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); Future<PlatformParameters> platformParametersFuture = intermediateBuilderExecutor.submit(() -> connector.getPlatformParameters(stack, userCrn)); SecurityConfig securityConfig = securityConfigService.generateAndSaveSecurityConfig(stack); stack.setSecurityConfig(securityConfig); stackService.save(stack); SaltSecurityConfig saltSecurityConfig = securityConfig.getSaltSecurityConfig(); String cbPrivKey = saltSecurityConfig.getSaltBootSignPrivateKey(); byte[] cbSshKeyDer = PkiUtil.getPublicKeyDer(new String(Base64.decodeBase64(cbPrivKey))); String sshUser = stack.getStackAuthentication().getLoginUserName(); String cbCert = securityConfig.getClientCert(); String saltBootPassword = saltSecurityConfig.getSaltBootPassword(); try { PlatformParameters platformParameters = platformParametersFuture.get(); CcmConnectivityParameters ccmParameters = fetchCcmParameters(stack); Optional<ProxyConfig> proxyConfig = proxyConfigDtoService.getByEnvironmentCrn(stack.getEnvironmentCrn()); Map<InstanceGroupType, String> userData = userDataBuilder.buildUserData(Platform.platform(stack.getCloudPlatform()), cbSshKeyDer, sshUser, platformParameters, saltBootPassword, cbCert, ccmParameters, proxyConfig.orElse(null)); imageService.decorateImageWithUserDataForStack(stack, userData); saveStackCCMParameters(stack, ccmParameters); } catch (InterruptedException | ExecutionException e) { LOGGER.error("Failed to get Platform parmaters", e); throw new GetCloudParameterException("Failed to get Platform parmaters", e); } }

Target:
public void createUserData(Long stackId) throws CloudbreakImageNotFoundException { Stack stack = stackService.getByIdWithLists(stackId); String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); Future<PlatformParameters> platformParametersFuture = intermediateBuilderExecutor.submit(() -> connector.getPlatformParameters(stack, userCrn)); SecurityConfig securityConfig = securityConfigService.generateAndSaveSecurityConfig(stack); stack.setSecurityConfig(securityConfig); stackService.save(stack); SaltSecurityConfig saltSecurityConfig = securityConfig.getSaltSecurityConfig(); String cbPrivKey = saltSecurityConfig.getSaltBootSignPrivateKey(); byte[] cbSshKeyDer = PkiUtil.getPublicKeyDer(new String(Base64.decodeBase64(cbPrivKey))); String sshUser = stack.getStackAuthentication().getLoginUserName(); String cbCert = securityConfig.getClientCert(); String saltBootPassword = saltSecurityConfig.getSaltBootPassword(); try { PlatformParameters platformParameters = platformParametersFuture.get(); CcmConnectivityParameters ccmParameters = ccmUserDataService.fetchAndSaveCcmParameters(stack); Optional<ProxyConfig> proxyConfig = proxyConfigDtoService.getByEnvironmentCrn(stack.getEnvironmentCrn()); Map<InstanceGroupType, String> userData = userDataBuilder.buildUserData(Platform.platform(stack.getCloudPlatform()), cbSshKeyDer, sshUser, platformParameters, saltBootPassword, cbCert, ccmParameters, proxyConfig.orElse(null)); imageService.decorateImageWithUserDataForStack(stack, userData); } catch (InterruptedException | ExecutionException e) { LOGGER.error("Failed to get Platform parmaters", e); throw new GetCloudParameterException("Failed to get Platform parmaters", e); } }