brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [06/10] git commit: Jclouds byon: support privateKeyFile config
Date Tue, 05 Aug 2014 05:24:50 GMT
Jclouds byon: support privateKeyFile config

Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/f6878b16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/f6878b16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/f6878b16

Branch: refs/heads/master
Commit: f6878b160e86758b49137540f2fe716d1ebeab70
Parents: d0af981
Author: Aled Sage <aled.sage@gmail.com>
Authored: Thu Jul 31 06:55:15 2014 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Thu Jul 31 06:55:15 2014 +0100

----------------------------------------------------------------------
 .../location/jclouds/JcloudsByonLocationResolver.java         | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f6878b16/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
index bb16c43..439cd85 100644
--- a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
+++ b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
@@ -72,7 +72,7 @@ public class JcloudsByonLocationResolver implements LocationResolver {
 
     private static final Pattern PATTERN = Pattern.compile("("+BYON+"|"+BYON.toUpperCase()+")"
+ ":" + "\\((.*)\\)$");
 
-    private static final Set<String> ACCEPTABLE_ARGS = ImmutableSet.of("provider",
"region", "endpoint", "hosts", "name", "user");
+    private static final Set<String> ACCEPTABLE_ARGS = ImmutableSet.of("provider",
"region", "endpoint", "hosts", "name", "user", "privateKeyFile");
 
     private ManagementContext managementContext;
 
@@ -110,6 +110,8 @@ public class JcloudsByonLocationResolver implements LocationResolver {
 
         String user = argsMap.containsKey("user") ? argsMap.get("user") : (String)locationFlags.get("user");
 
+        String privateKeyFile = argsMap.containsKey("privateKeyFile") ? argsMap.get("privateKeyFile")
: (String)locationFlags.get("privateKeyFile");
+        
         String hosts = argsMap.get("hosts");
         
         if (!ACCEPTABLE_ARGS.containsAll(argsMap.keySet())) {
@@ -143,8 +145,9 @@ public class JcloudsByonLocationResolver implements LocationResolver {
         
         for (String hostIdentifier : hostIdentifiers) {
             Map<?, ?> machineFlags = MutableMap.builder()
-                    .put("id", hostIdentifier) 
+                    .put("id", hostIdentifier)
                     .putIfNotNull("user", user)
+                    .putIfNotNull("privateKeyFile", privateKeyFile)
                     .build();
             try {
                 JcloudsSshMachineLocation machine = jcloudsLocation.rebindMachine(jcloudsLocation.getAllConfigBag().putAll(machineFlags));


Mime
View raw message