You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2017/10/27 12:37:13 UTC
[1/2] brooklyn-server git commit: Revert "Retrieve the right AWS
metadata for private hostname"
Repository: brooklyn-server
Updated Branches:
refs/heads/master e73ee2912 -> 5eb08b262
Revert "Retrieve the right AWS metadata for private hostname"
This reverts commit 8877368aa4c04e21eecd167538f878c4e0681900.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/2fb23337
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/2fb23337
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/2fb23337
Branch: refs/heads/master
Commit: 2fb23337d48611a5cf9deb061cbd29f7b7137718
Parents: e73ee29
Author: graeme.miller <gr...@cloudsoftcorp.com>
Authored: Fri Oct 27 13:18:57 2017 +0100
Committer: graeme.miller <gr...@cloudsoftcorp.com>
Committed: Fri Oct 27 13:18:57 2017 +0100
----------------------------------------------------------------------
.../brooklyn/location/jclouds/JcloudsLocation.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/2fb23337/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
index 39ccc52..80e289a 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
@@ -2827,11 +2827,16 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
return getPublicHostname(node, sshHostAndPort, userCredentials, setup);
}
- // NodeMetadata.getHostname() is supposed to return the private hostname. If it's not null, we want to prioritise
- // this, otherwise we call getPrivateHostnameGeneric()
- final String hostname = node.getHostname();
- if (hostname != null) {
- return hostname;
+ String provider = (setup != null) ? setup.get(CLOUD_PROVIDER) : null;
+ Boolean lookupAwsHostname = (setup != null) ? setup.get(LOOKUP_AWS_HOSTNAME) : null;
+ if (provider == null) provider = getProvider();
+
+ // TODO Discouraged to do cloud-specific things; think of this code for aws as an
+ // exceptional situation rather than a pattern to follow. We need a better way to
+ // do cloud-specific things.
+ if ("aws-ec2".equals(provider) && Boolean.TRUE.equals(lookupAwsHostname)) {
+ Maybe<String> result = getHostnameAws(node, sshHostAndPort, userCredentials, setup);
+ if (result.isPresent()) return result.get();
}
Optional<String> preferredAddress = sshHostAndPort.isPresent() ? Optional.of(sshHostAndPort.get().getHostText()) : Optional.<String>absent();
[2/2] brooklyn-server git commit: This closes #871
Posted by al...@apache.org.
This closes #871
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/5eb08b26
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/5eb08b26
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/5eb08b26
Branch: refs/heads/master
Commit: 5eb08b26253b2249fec2c3df279a8b391177b1e3
Parents: e73ee29 2fb2333
Author: Aled Sage <al...@gmail.com>
Authored: Fri Oct 27 13:37:00 2017 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Fri Oct 27 13:37:00 2017 +0100
----------------------------------------------------------------------
.../brooklyn/location/jclouds/JcloudsLocation.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------