use different settings for aws proxy port / host

This commit is contained in:
kimchy 2011-05-03 16:43:52 +03:00
parent 8eb6e91eac
commit 7379258f2e
2 changed files with 8 additions and 8 deletions

View File

@ -68,14 +68,14 @@ public class AwsEc2Service extends AbstractLifecycleComponent<AwsEc2Service> {
throw new ElasticSearchIllegalArgumentException("No s3 secret_key defined for s3 gateway"); throw new ElasticSearchIllegalArgumentException("No s3 secret_key defined for s3 gateway");
} }
String proxyHost = settings.get("network.proxyHost"); String proxyHost = componentSettings.get("proxy_host");
if (proxyHost != null) { if (proxyHost != null) {
String portString = settings.get("network.proxyPort","80"); String portString = componentSettings.get("proxy_port", "80");
Integer proxyPort; Integer proxyPort;
try { try {
proxyPort = Integer.parseInt(portString,10); proxyPort = Integer.parseInt(portString, 10);
} catch (NumberFormatException ex) { } catch (NumberFormatException ex) {
throw new ElasticSearchIllegalArgumentException("The configured proxy port value [" + portString + "] is invalid",ex); throw new ElasticSearchIllegalArgumentException("The configured proxy port value [" + portString + "] is invalid", ex);
} }
clientConfiguration.withProxyHost(proxyHost).setProxyPort(proxyPort); clientConfiguration.withProxyHost(proxyHost).setProxyPort(proxyPort);
} }

View File

@ -68,14 +68,14 @@ public class AwsS3Service extends AbstractLifecycleComponent<AwsS3Service> {
throw new ElasticSearchIllegalArgumentException("No s3 secret_key defined for s3 gateway"); throw new ElasticSearchIllegalArgumentException("No s3 secret_key defined for s3 gateway");
} }
String proxyHost = settings.get("network.proxyHost"); String proxyHost = componentSettings.get("proxy_host");
if (proxyHost != null) { if (proxyHost != null) {
String portString = settings.get("network.proxyPort","80"); String portString = componentSettings.get("proxy_port", "80");
Integer proxyPort; Integer proxyPort;
try { try {
proxyPort = Integer.parseInt(portString,10); proxyPort = Integer.parseInt(portString, 10);
} catch (NumberFormatException ex) { } catch (NumberFormatException ex) {
throw new ElasticSearchIllegalArgumentException("The configured proxy port value [" + portString + "] is invalid",ex); throw new ElasticSearchIllegalArgumentException("The configured proxy port value [" + portString + "] is invalid", ex);
} }
clientConfiguration.withProxyHost(proxyHost).setProxyPort(proxyPort); clientConfiguration.withProxyHost(proxyHost).setProxyPort(proxyPort);
} }