Github user tbouron commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/849#discussion_r142158986
--- Diff:
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
---
@@ -2957,7 +2957,7 @@ String getHostnameAws(HostAndPort hostAndPort,
LoginCredentials userCredentials,
"get public AWS hostname",
ImmutableList.of(
BashCommands.INSTALL_CURL,
- "echo `curl --silent --retry 20
http://169.254.169.254/latest/meta-data/public-hostname`; exit"));
+ "echo `curl --silent --retry 20
http://169.254.169.254/latest/meta-data/"+(privateHost ? "local-hostname" :
"public-hostname")+"`; exit"));
--- End diff --
If you are ok to add even more code + duplication then sure, no problem,
I'll do that :D
Agree this is a code smell (which [has already been identified based on
this
comment](https://github.com/tbouron/brooklyn-server/blob/2455e054a62cbfff874c07c70f6cdf897f19769e/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java#L2836-L2838))
but I don't have a magical solution to improve this particular area. If you
have any idea, I'm opened to suggestions
---