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

    https://github.com/apache/incubator-brooklyn/pull/370#discussion_r23770388
  
    --- Diff: 
software/base/src/main/java/brooklyn/entity/brooklynnode/effector/BrooklynNodeUpgradeEffectorBody.java
 ---
    @@ -132,44 +193,34 @@ public Void call(ConfigBag parametersO) {
                 Predicates.equalTo(ManagementNodeState.HOT_STANDBY), 
Duration.FIVE_MINUTES));
     
             // 3 stop new version
    -        // 4 stop old version
    -        ConfigBag stopParameters = ConfigBag.newInstance();
    -        stopParameters.put(StopSoftwareParameters.STOP_MACHINE, 
Boolean.FALSE);
    -        DynamicTasks.queue(Tasks.builder().name("shutdown original and 
transient nodes")
    -            .add(Effectors.invocation(dryRunChild, 
BrooklynNode.STOP_NODE_BUT_LEAVE_APPS, stopParameters))
    -            .add(Effectors.invocation(entity(), 
BrooklynNode.STOP_NODE_BUT_LEAVE_APPS, stopParameters))
    +        DynamicTasks.queue(Tasks.builder().name("shutdown transient node")
    +            .add(Effectors.invocation(dryRunChild, 
BrooklynNode.STOP_NODE_BUT_LEAVE_APPS, 
ImmutableMap.of(StopSoftwareParameters.STOP_MACHINE, Boolean.FALSE)))
                 .build());
     
    -        // 5 move old files, and move new files
    -        DynamicTasks.queue(Tasks.builder().name("setup new 
version").body(new Runnable() {
    -            @Override
    -            public void run() {
    -                String runDir = 
entity().getAttribute(SoftwareProcess.RUN_DIR);
    -                String bkDir = Urls.mergePaths(runDir, "..", 
Urls.getBasename(runDir)+"-backups", dryRunNodeUid);
    -                String dryRunDir = 
Preconditions.checkNotNull(dryRunChild.getAttribute(SoftwareProcess.RUN_DIR));
    -                log.debug(this+" storing backup of previous version in 
"+bkDir);
    -                DynamicTasks.queue(SshEffectorTasks.ssh(
    -                    "cd "+runDir,
    -                    "mkdir -p "+bkDir,
    -                    "mv * "+bkDir,
    -                    "cd "+dryRunDir,
    -                    "mv * "+runDir
    -                    ).summary("move files"));
    +        DynamicTasks.queue(Tasks.<Void>builder().name("remove transient 
node").body(
    +            new Runnable() {
    +                @Override
    +                public void run() {
    +                    Entities.unmanage(dryRunChild);
    +                }
                 }
    -        }).build());
    -        
    -        DynamicTasks.waitForLast();
    -        entity().setConfig(SoftwareProcess.INSTALL_UNIQUE_LABEL, null);
    -        entity().getConfigMap().addToLocalBag(parameters.getAllConfig());
    -        
((BrooklynNodeDriver)((DriverDependentEntity<?>)entity()).getDriver()).clearInstallDir();
    +        ).build());
     
    -        // 6 start this entity, running the new version
    -        DynamicTasks.queue(Effectors.invocation(entity(), 
BrooklynNode.START, ConfigBag.EMPTY));
    +        return dryRunChild.getId();
    +    }
     
    -        DynamicTasks.waitForLast();
    -        Entities.unmanage(dryRunChild);
    +    protected EntitySpec<? extends BrooklynNode> createDryRunSpec() {
    +        return EntitySpec.create(BrooklynNode.class);
    +    }
     
    -        return null;
    +    protected SshMachineLocation getSshMachineLocation() {
    --- End diff --
    
    Removed it altogether, couldn't find any usages (even in subclasses).


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