@Override protected Account editAccount(OpenstackAccount account) { account.setUserDataFile(isSet(userDataFile) ? userDataFile : account.getUserDataFile()); account.setHeatTemplateLocation(isSet(heatTemplateLocation) ? heatTemplateLocation : account.getHeatTemplateLocation()); account.setConsulConfig(isSet(consulConfig) ? consulConfig : account.getConsulConfig()); account.setAccountType(isSet(accountType) ? accountType : account.getAccountType()); account.setAuthUrl(isSet(authUrl) ? authUrl : account.getAuthUrl()); account.setUsername(isSet(username) ? username : account.getUsername()); account.setPassword(isSet(password) ? password : account.getPassword()); account.setProjectName(isSet(projectName) ? projectName : account.getProjectName()); account.setDomainName(isSet(domainName) ? domainName : account.getDomainName()); account.setInsecure(isSet(insecure) ? insecure : account.getInsecure()); List<String> existingRegions = account.getRegions(); List<String> newRegions = updateStringList(existingRegions, regions, addRegion, removeRegion); account.setRegions(newRegions); }catch (IllegalArgumentException e) { throw new IllegalArgumentException("Set either --regions or --[add/remove]-region"); OpenstackAccount.OpenstackLbaasOptions lbaas = account.getLbaas(); if (isSet(lbaasPollInterval) || isSet(lbaasPollTimeout)) { if (isSet(lbaasPollInterval)) { lbaas.setPollTimeout(lbaasPollTimeout); account.setLbaas(lbaas);
@Override public void validate(ConfigProblemSetBuilder psBuilder, OpenstackAccount account) { DaemonTaskHandler.message("Validating " + account.getNodeName() + " with " + OpenstackAccountValidator.class.getSimpleName()); String environment = account.getEnvironment(); String accountType = account.getAccountType(); String username = account.getUsername(); String password = account.getPassword(); String projectName = account.getPassword(); String domainName = account.getDomainName(); String authUrl = account.getAuthUrl(); List<String> regions = account.getRegions(); Boolean insecure = account.getInsecure(); String heatTemplateLocation = account.getHeatTemplateLocation(); OpenstackAccount.OpenstackLbaasOptions lbaas = account.getLbaas(); ConsulConfig consulConfig = new ConsulConfig(); String userDataFile = account.getUserDataFile(); .name(account.getName()) .environment(environment) .accountType(accountType) psBuilder.addProblem(Problem.Severity.ERROR, "Failed to instantiate openstack credentials for account \"" + account.getName() + "\".");
if (openstackProvider.getPrimaryAccount() != null) { OpenstackAccount openstackAccount = (OpenstackAccount) accountService.getProviderAccount(deploymentConfiguration.getName(), "openstack", openstackProvider.getPrimaryAccount()); String firstRegion = openstackAccount.getRegions().get(0); bindings.put("openstack.default.region", firstRegion);
@Override public void validate(ConfigProblemSetBuilder psBuilder, OpenstackAccount account) { DaemonTaskHandler.message("Validating " + account.getNodeName() + " with " + OpenstackAccountValidator.class.getSimpleName()); String environment = account.getEnvironment(); String accountType = account.getAccountType(); String username = account.getUsername(); String password = account.getPassword(); String projectName = account.getPassword(); String domainName = account.getDomainName(); String authUrl = account.getAuthUrl(); List<String> regions = account.getRegions(); Boolean insecure = account.getInsecure(); String heatTemplateLocation = account.getHeatTemplateLocation(); OpenstackAccount.OpenstackLbaasOptions lbaas = account.getLbaas(); ConsulConfig consulConfig = new ConsulConfig(); String userDataFile = account.getUserDataFile(); .name(account.getName()) .environment(environment) .accountType(accountType) psBuilder.addProblem(Problem.Severity.ERROR, "Failed to instantiate openstack credentials for account \"" + account.getName() + "\".");
if (openstackProvider.getPrimaryAccount() != null) { OpenstackAccount openstackAccount = (OpenstackAccount) accountService.getProviderAccount(deploymentConfiguration.getName(), "openstack", openstackProvider.getPrimaryAccount()); String firstRegion = openstackAccount.getRegions().get(0); bindings.put("openstack.default.region", firstRegion);
@Override protected Account editAccount(OpenstackAccount account) { account.setUserDataFile(isSet(userDataFile) ? userDataFile : account.getUserDataFile()); account.setHeatTemplateLocation(isSet(heatTemplateLocation) ? heatTemplateLocation : account.getHeatTemplateLocation()); account.setConsulConfig(isSet(consulConfig) ? consulConfig : account.getConsulConfig()); account.setAccountType(isSet(accountType) ? accountType : account.getAccountType()); account.setAuthUrl(isSet(authUrl) ? authUrl : account.getAuthUrl()); account.setUsername(isSet(username) ? username : account.getUsername()); account.setPassword(isSet(password) ? password : account.getPassword()); account.setProjectName(isSet(projectName) ? projectName : account.getProjectName()); account.setDomainName(isSet(domainName) ? domainName : account.getDomainName()); account.setInsecure(isSet(insecure) ? insecure : account.getInsecure()); List<String> existingRegions = account.getRegions(); List<String> newRegions = updateStringList(existingRegions, regions, addRegion, removeRegion); account.setRegions(newRegions); }catch (IllegalArgumentException e) { throw new IllegalArgumentException("Set either --regions or --[add/remove]-region"); OpenstackAccount.OpenstackLbaasOptions lbaas = account.getLbaas(); if (isSet(lbaasPollInterval) || isSet(lbaasPollTimeout)) { if (isSet(lbaasPollInterval)) { lbaas.setPollTimeout(lbaasPollTimeout); account.setLbaas(lbaas);