Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/465#discussion_r23521372
--- Diff:
locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
---
@@ -752,6 +762,17 @@ protected JcloudsSshMachineLocation
obtainOnce(ConfigBag setup) throws NoMachine
List<String> cmds =
ImmutableList.of(IptablesCommands.iptablesServiceStop(),
IptablesCommands.iptablesServiceStatus());
sshMachineLocation.execCommands("Stopping iptables",
cmds);
}
+
+ List<String> extraKeyUrlsToAuth =
setup.get(EXTRA_PUBLIC_KEYS_TO_AUTH);
+ if (extraKeyUrlsToAuth!=null &&
!extraKeyUrlsToAuth.isEmpty()) {
+ List<String> extraKeyDataToAuth = MutableList.of();
+ for (String keyUrl: extraKeyUrlsToAuth) {
+
extraKeyDataToAuth.add(ResourceUtils.create().getResourceAsString(keyUrl));
+ }
+ sshMachineLocation.execCommands("Authorizing ssh
keys",
+ MutableList.of(new
AuthorizeRSAPublicKeys(extraKeyDataToAuth).render(org.jclouds.scriptbuilder.domain.OsFamily.UNIX)));
--- End diff --
Personal preference: I prefer us using `ImmutableList` everywhere that we
expect no nulls and expect not to modify it. In this case, a null is going to
be a programming error / bug somewhere so `ImmutableList` feels better.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---