Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/866#discussion_r38082876
  
    --- Diff: 
software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java
 ---
    @@ -129,10 +132,40 @@ protected WinRmToolResponse 
executeCommand(ConfigKey<String> regularCommandKey,
                 throw new IllegalStateException(String.format("%s and %s 
cannot both be set", regularCommandKey.getName(), 
powershellCommandKey.getName()));
             }
     
    +        WinRmToolResponse response;
             if (Strings.isNullOrEmpty(regularCommand)) {
    -            return 
getLocation().executePsScript(ImmutableList.of(powershellCommand));
    +            response = 
getLocation().executePsScript(ImmutableList.of(powershellCommand));
             } else {
    -            return 
getLocation().executeScript(ImmutableList.of(regularCommand));
    +            response = 
getLocation().executeScript(ImmutableList.of(regularCommand));
    +        }
    +
    +        if (Tasks.current()!=null) {
    --- End diff --
    
    I'd cache whether we've made use of these stdOut/stdErr, rather than 
calling `if (Tasks.current()!=null)` again. If we added those tags previously 
then call `writeToStream` (rather than also looking up the 
`BrooklynTaskTags.stream()` again - no need to do that).


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to