brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grk...@apache.org
Subject [10/14] git commit: Set SSH flags for directory creation
Date Mon, 06 Oct 2014 11:56:42 GMT
Set SSH flags for directory creation


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

Branch: refs/heads/master
Commit: d5293bdb40d881fe9a87de5c35e380528dfbd507
Parents: e76e589
Author: Andrew Kennedy <grkvlt@apache.org>
Authored: Sun Oct 5 23:00:40 2014 +0100
Committer: Andrew Kennedy <grkvlt@apache.org>
Committed: Sun Oct 5 23:47:00 2014 +0100

----------------------------------------------------------------------
 .../entity/basic/AbstractSoftwareProcessSshDriver.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d5293bdb/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
index c1d7d94..0e4ddf0 100644
--- a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
+++ b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
@@ -263,11 +263,15 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
     protected Map<String, Object> getSshFlags() {
         return SshEffectorTasks.getSshFlags(getEntity(), getMachine());
     }
-    
+
+    public int execute(String command, String summaryForLogging) {
+        return execute(ImmutableList.of(command), summaryForLogging);
+    }
+
     public int execute(List<String> script, String summaryForLogging) {
         return execute(Maps.newLinkedHashMap(), script, summaryForLogging);
     }
-    
+
     @SuppressWarnings({ "rawtypes", "unchecked" })
     @Override
     public int execute(Map flags2, List<String> script, String summaryForLogging) {
@@ -307,7 +311,7 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
     public void copyInstallResources() {
         getLocation().acquireMutex("installing "+elvis(entity,this),  "installation lock
at host for files and templates");
         try {
-            getLocation().execCommands("create install directory", ImmutableList.of("mkdir
-p " + getInstallDir()));
+            execute("mkdir -p " + getInstallDir(), "create install directory");
 
             Map<String, String> installFiles = entity.getConfig(SoftwareProcess.INSTALL_FILES);
             if (installFiles != null && installFiles.size() > 0) {
@@ -348,7 +352,7 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
     @Override
     public void copyRuntimeResources() {
         try {
-            getLocation().execCommands("create run directory", ImmutableList.of("mkdir -p
" + getRunDir()));
+            execute("mkdir -p " + getRunDir(), "create run directory");
 
             Map<String, String> runtimeFiles = entity.getConfig(SoftwareProcess.RUNTIME_FILES);
             if (runtimeFiles != null && runtimeFiles.size() > 0) {


Mime
View raw message