Github user Graeme-Miller commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1124#discussion_r48825730
--- Diff:
brooklyn-server/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java
---
@@ -220,13 +221,34 @@ public void stop() {
//but that could be handled by the impl at management
//(keeping recently unmanaged things)
// however unmanaging must be done last, _after_ we stop
children and set attributes
+ Location location = Iterables.getFirst(getLocations(),
null);
getEntityManager().unmanage(this);
+ unmanageProvisionerIfNotUsed(location);
}
}
logApplicationLifecycle("Stopped");
}
+
+ private boolean
unmanageProvisionerIfNotUsed(/*MachineProvisioningLocation<MachineLocation>*/Location
provisioner) {
+ if (provisioner.getChildren().isEmpty()) {
+ Entity parentEntity = getParent();
+ if (parentEntity == null) {
+
getManagementContext().getLocationManager().unmanage(provisioner);
+ return true;
+ } else {
+ /*
--- End diff --
Else block code is commented out. What is the purpose of this section? Is
it complete?
---
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.
---