From 295dbb25cf85857d46914610bef3f36b12883eb8 Mon Sep 17 00:00:00 2001 From: Duncan Godwin Date: Fri, 13 Jan 2017 17:25:59 +0000 Subject: [PATCH] Specify the Azure ARM region --- .../location/jclouds/ComputeServiceRegistryImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/ComputeServiceRegistryImpl.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/ComputeServiceRegistryImpl.java index 64d168e4cb..403c5b5db8 100644 --- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/ComputeServiceRegistryImpl.java +++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/ComputeServiceRegistryImpl.java @@ -90,7 +90,7 @@ public ComputeService findComputeService(ConfigBag conf, boolean allowReuse) { // retrying their API calls. properties.setProperty(Constants.PROPERTY_RETRY_DELAY_START, "500"); properties.setProperty(Constants.PROPERTY_MAX_RETRIES, "6"); - + // Enable aws-ec2 lazy image fetching, if given a specific imageId; otherwise customize for specific owners; or all as a last resort // See https://issues.apache.org/jira/browse/WHIRR-416 if ("aws-ec2".equals(provider)) { @@ -139,6 +139,12 @@ public ComputeService findComputeService(ConfigBag conf, boolean allowReuse) { // the default timeout was 500ms so let's raise it in case that helps properties.setProperty(EC2Constants.PROPERTY_EC2_TIMEOUT_SECURITYGROUP_PRESENT, ""+Duration.seconds(30).toMilliseconds()); } + else if ("azurecompute-arm".equals(provider)) { + String region = conf.get(CLOUD_REGION_ID); + if (Strings.isNonBlank(region)) { + properties.setProperty(LocationConstants.PROPERTY_REGIONS, region); + } + } // FIXME Deprecated mechanism, should have a ConfigKey for overrides Map extra = Maps.filterKeys(conf.getAllConfig(), Predicates.containsPattern("^jclouds\\."));