algairim commented on code in PR #1325:
URL: https://github.com/apache/brooklyn-server/pull/1325#discussion_r907355718


##########
core/src/main/java/org/apache/brooklyn/core/entity/Entities.java:
##########
@@ -948,10 +955,22 @@ public static ManagementContext 
startManagement(Application app, ManagementConte
             }
         }
 
+        premanageRecursively((ManagementContextInternal)mgmt, app);
+
         mgmt.getEntityManager().manage(app);
         return mgmt;
     }
 
+    private static void premanageRecursively(ManagementContextInternal mgmt, 
Entity e) {
+        if (Entities.isUnmanagingOrNoLongerManaged(e) || 
Entities.isManagedActive(e)) {
+            log.warn("Skipping premanagement for "+e+", as it has some form of 
known management");
+            // skip for active and unmanaged entities
+            return;
+        }
+        mgmt.prePreManage(e);

Review Comment:
   Can it be that this condition is required for a particular entity, but not 
for its children?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to