brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drigod...@apache.org
Subject [1/2] brooklyn-server git commit: WinRmCommandSensor default executionDir
Date Thu, 16 Mar 2017 09:37:52 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master b95932a7c -> 9eaa969d9


WinRmCommandSensor default executionDir

Use default dir obtained on the winrm sesion
until Apache Brooklyn has working concept for RUN_DIR on VanillaWindowsProcess


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

Branch: refs/heads/master
Commit: 3ec766c221aa61f45e6f7a07ba042e6af06509f7
Parents: 37c3747
Author: Valentin Aitken <bostko@gmail.com>
Authored: Wed Mar 15 17:43:27 2017 +0200
Committer: Valentin Aitken <bostko@gmail.com>
Committed: Wed Mar 15 17:43:27 2017 +0200

----------------------------------------------------------------------
 .../brooklyn/core/sensor/windows/WinRmCommandSensor.java  | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3ec766c2/software/winrm/src/main/java/org/apache/brooklyn/core/sensor/windows/WinRmCommandSensor.java
----------------------------------------------------------------------
diff --git a/software/winrm/src/main/java/org/apache/brooklyn/core/sensor/windows/WinRmCommandSensor.java
b/software/winrm/src/main/java/org/apache/brooklyn/core/sensor/windows/WinRmCommandSensor.java
index 18fd0ea..ecc0d59 100644
--- a/software/winrm/src/main/java/org/apache/brooklyn/core/sensor/windows/WinRmCommandSensor.java
+++ b/software/winrm/src/main/java/org/apache/brooklyn/core/sensor/windows/WinRmCommandSensor.java
@@ -144,15 +144,7 @@ public final class WinRmCommandSensor<T> extends AddSensor<T>
{
     public static String makeCommandExecutingInDirectory(String command, String executionDir,
Entity entity) {
         String finalCommand = command;
         String execDir = executionDir;
-        if (Strings.isBlank(execDir)) {
-            // default to run dir
-            execDir = entity.getAttribute(BrooklynConfigKeys.RUN_DIR);
-            // if no run dir, default to home
-            if (Strings.isBlank(execDir)) {
-                execDir = "%USERPROFILE%";
-            }
-        }
-        if (!"~".equals(execDir)) {
+        if (Strings.isNonBlank(execDir) && !"~".equals(execDir)) {
             finalCommand = "(if exist \"" + execDir + "\" (rundll32) else (mkdir \""+execDir+"\"))
&& cd \""+execDir+"\" && "+finalCommand;
         }
         return finalCommand;


Mime
View raw message