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

    https://github.com/apache/incubator-brooklyn/pull/866#discussion_r37966662
  
    --- Diff: 
software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessWinRmDriver.java
 ---
    @@ -37,31 +42,36 @@ public void start() {
     
             super.start();
         }
    -    
    +
         @Override
    -    public void preInstall() {
    -        super.preInstall();
    -        executeCommand(VanillaWindowsProcess.PRE_INSTALL_COMMAND, 
VanillaWindowsProcess.PRE_INSTALL_POWERSHELL_COMMAND, true);
    -        if 
(entity.getConfig(VanillaWindowsProcess.PRE_INSTALL_REBOOT_REQUIRED)) {
    -            rebootAndWait();
    +    public void runPreInstallCommand() {
    +        
if(Strings.isNonBlank(getEntity().getConfig(VanillaWindowsProcess.PRE_INSTALL_COMMAND))
 || 
Strings.isNonBlank(getEntity().getConfig(VanillaWindowsProcess.PRE_INSTALL_POWERSHELL_COMMAND)))
 {
    +            executeCommand(VanillaWindowsProcess.PRE_INSTALL_COMMAND, 
VanillaWindowsProcess.PRE_INSTALL_POWERSHELL_COMMAND, true);
    +            if 
(entity.getConfig(VanillaWindowsProcess.PRE_INSTALL_REBOOT_REQUIRED)) {
    +                rebootAndWait();
    +            }
             }
         }
     
         @Override
         public void install() {
             // TODO: Follow install path of VanillaSoftwareProcessSshDriver
    -        executeCommand(VanillaWindowsProcess.INSTALL_COMMAND, 
VanillaWindowsProcess.INSTALL_POWERSHELL_COMMAND, true);
    -        if 
(entity.getConfig(VanillaWindowsProcess.INSTALL_REBOOT_REQUIRED)) {
    -            rebootAndWait();
    +        
if(Strings.isNonBlank(getEntity().getConfig(VanillaWindowsProcess.INSTALL_COMMAND))
 || 
Strings.isNonBlank(getEntity().getConfig(VanillaWindowsProcess.INSTALL_POWERSHELL_COMMAND)))
 {
    +            executeCommand(VanillaWindowsProcess.INSTALL_COMMAND, 
VanillaWindowsProcess.INSTALL_POWERSHELL_COMMAND, true);
    +            if 
(entity.getConfig(VanillaWindowsProcess.INSTALL_REBOOT_REQUIRED)) {
    --- End diff --
    
    Same here and in the other commands: move the reboot check outside of the 
outer if block.


---
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