brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bostko <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #596: WinRmCommandSensor default executionDir
Date Wed, 15 Mar 2017 15:58:19 GMT
Github user bostko commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/596#discussion_r106205545
  
    --- Diff: software/winrm/src/main/java/org/apache/brooklyn/core/sensor/windows/WinRmCommandSensor.java
---
    @@ -144,15 +144,7 @@ public T apply(String input) {
         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)) {
    --- End diff --
    
    Default directory is `%USERPROFILE%`.
    You can try by setting a sensor from `command: dir`.
    We already use the same default directory for launch.command and other commands in `VanillaWindowsProcess`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message