brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drigod...@apache.org
Subject [3/6] brooklyn-server git commit: Fix JcloudsLocation.registerMachine(ConfigBag)
Date Wed, 31 May 2017 15:12:01 GMT
Fix JcloudsLocation.registerMachine(ConfigBag)

It now combines the config().getBag() with the config passed in.

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

Branch: refs/heads/master
Commit: 6b5f748b594e17f272c059738af1227456009f89
Parents: 947d5ae
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue May 30 10:57:10 2017 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Tue May 30 16:32:48 2017 +0100

----------------------------------------------------------------------
 .../location/jclouds/JcloudsByonLocationResolver.java   |  3 ++-
 .../brooklyn/location/jclouds/JcloudsLocation.java      | 12 ++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/6b5f748b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
index dac284f..31ef408 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsByonLocationResolver.java
@@ -43,6 +43,7 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
 
 /**
@@ -155,7 +156,7 @@ public class JcloudsByonLocationResolver extends AbstractLocationResolver
implem
                 for (Map<?,?> machineFlags : machinesFlags) {
                     try {
                         jcloudsLocation.config().putAll(machineFlags);
-                        JcloudsMachineLocation machine = jcloudsLocation.registerMachine(jcloudsLocation.config().getBag());
+                        JcloudsMachineLocation machine = jcloudsLocation.registerMachine(ImmutableMap.of());
                         result.add(machine);
                     } catch (NoMachinesAvailableException e) {
                         Map<?,?> sanitizedMachineFlags = Sanitizer.sanitize(machineFlags);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/6b5f748b/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 e91b588..9fd4b36 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
@@ -1772,11 +1772,11 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
 
     // ----------------- registering existing machines ------------------------
 
-    protected MachineLocation registerMachine(NodeMetadata metadata) throws NoMachinesAvailableException
{
+    protected JcloudsMachineLocation registerMachine(NodeMetadata metadata) throws NoMachinesAvailableException
{
         return registerMachine(MutableMap.of(), metadata);
     }
 
-    protected MachineLocation registerMachine(Map<?, ?> flags, NodeMetadata metadata)
throws NoMachinesAvailableException {
+    protected JcloudsMachineLocation registerMachine(Map<?, ?> flags, NodeMetadata
metadata) throws NoMachinesAvailableException {
         ConfigBag setup = ConfigBag.newInstanceExtending(config().getBag(), flags);
         if (!setup.containsKey("id")) setup.putStringKey("id", metadata.getId());
         setHostnameUpdatingCredentials(setup, metadata);
@@ -1793,7 +1793,8 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
      *   <li>userName: the username for sshing into the machine (for use if it is not
a Windows system)
      * <ul>
      */
-    public JcloudsMachineLocation registerMachine(ConfigBag setup) throws NoMachinesAvailableException
{
+    public JcloudsMachineLocation registerMachine(ConfigBag flags) throws NoMachinesAvailableException
{
+        ConfigBag setup = ConfigBag.newInstanceExtending(config().getBag(), flags.getAllConfig());
         NodeMetadata node = findNodeOrThrow(setup);
         return registerMachineLocation(setup, node);
     }
@@ -1871,9 +1872,8 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
         return node;
     }
 
-    public MachineLocation registerMachine(Map<?,?> flags) throws NoMachinesAvailableException
{
-        ConfigBag setup = ConfigBag.newInstanceExtending(config().getBag(), flags);
-        return registerMachine(setup);
+    public JcloudsMachineLocation registerMachine(Map<?,?> flags) throws NoMachinesAvailableException
{
+        return registerMachine(ConfigBag.newInstance(flags));
     }
 
     /**


Mime
View raw message