brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [2/4] incubator-brooklyn git commit: Minor changes re code review
Date Wed, 08 Apr 2015 09:26:27 GMT
Minor changes re code review


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

Branch: refs/heads/master
Commit: 58b3704428e0ed6d15bc289132ffd6f27fc5a13f
Parents: 497f99b
Author: Duncan Grant <duncan.grant@cloudsoftcorp.com>
Authored: Tue Apr 7 16:31:28 2015 +0100
Committer: Duncan Grant <duncan.grant@cloudsoftcorp.com>
Committed: Tue Apr 7 16:31:28 2015 +0100

----------------------------------------------------------------------
 .../messaging/rabbit/RabbitBrokerImpl.java      |  2 +-
 .../messaging/rabbit/RabbitSshDriver.java       | 33 +++++++++++---------
 2 files changed, 19 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/58b37044/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitBrokerImpl.java
----------------------------------------------------------------------
diff --git a/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitBrokerImpl.java
b/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitBrokerImpl.java
index 0184e73..fbbe384 100644
--- a/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitBrokerImpl.java
+++ b/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitBrokerImpl.java
@@ -103,7 +103,7 @@ public class RabbitBrokerImpl extends SoftwareProcessImpl implements RabbitBroke
     }
 
     public boolean getEnableManagementPlugin() {
-        return getConfig(ENABLE_MANAGEMENT_PLUGIN);
+        return Boolean.TRUE.equals(getConfig(ENABLE_MANAGEMENT_PLUGIN));
     }
 
     public Integer getManagementPort() {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/58b37044/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java
----------------------------------------------------------------------
diff --git a/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java
b/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java
index 534edb5..c2f4a7f 100644
--- a/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java
+++ b/software/messaging/src/main/java/brooklyn/entity/messaging/rabbit/RabbitSshDriver.java
@@ -18,6 +18,19 @@
  */
 package brooklyn.entity.messaging.rabbit;
 
+import static brooklyn.util.ssh.BashCommands.*;
+import static java.lang.String.format;
+
+import java.util.List;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+
 import brooklyn.entity.basic.AbstractSoftwareProcessSshDriver;
 import brooklyn.entity.basic.Entities;
 import brooklyn.entity.basic.lifecycle.ScriptHelper;
@@ -26,17 +39,6 @@ import brooklyn.location.basic.SshMachineLocation;
 import brooklyn.util.collections.MutableMap;
 import brooklyn.util.net.Networking;
 import brooklyn.util.os.Os;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-import java.util.Map;
-
-import static brooklyn.util.ssh.BashCommands.*;
-import static java.lang.String.format;
 
 /**
  * TODO javadoc
@@ -123,20 +125,21 @@ public class RabbitSshDriver extends AbstractSoftwareProcessSshDriver
implements
     @Override
     public void customize() {
         Networking.checkPortsValid(MutableMap.of("amqpPort", getAmqpPort()));
-        copyTemplate(entity.getConfig(RabbitBroker.CONFIG_TEMPLATE_URL), getConfigPath()
+ ".config");
         ScriptHelper scriptHelper = newScript(CUSTOMIZING);
 
         scriptHelper.body.append(
                 format("cp -R %s/* .", getExpandedInstallDir())
         );
 
-        if (entity.getConfig(RabbitBroker.ENABLE_MANAGEMENT_PLUGIN)) {
+        if (Boolean.TRUE.equals(entity.getConfig(RabbitBroker.ENABLE_MANAGEMENT_PLUGIN)))
{
             scriptHelper.body.append(
                     "./sbin/rabbitmq-plugins enable rabbitmq_management"
             );
         }
-
+        scriptHelper.failOnNonZeroResultCode();
         scriptHelper.execute();
+
+        copyTemplate(entity.getConfig(RabbitBroker.CONFIG_TEMPLATE_URL), getConfigPath()
+ ".config");
     }
 
     @Override
@@ -200,6 +203,6 @@ public class RabbitSshDriver extends AbstractSoftwareProcessSshDriver
implements
     }
 
     private String getConfigPath() {
-        return getInstallDir() + "/rabbitmq";
+        return getRunDir() + "/rabbitmq";
     }
 }


Mime
View raw message