Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/920#discussion_r40301541
--- Diff:
software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java
---
@@ -618,7 +620,16 @@ public void restart(ConfigBag parameters) {
if (isRestartMachine==RestartMachineMode.FALSE) {
DynamicTasks.queue("stopping (process)", new
StopProcessesAtMachineTask());
} else {
- DynamicTasks.queue("stopping (machine)", new
StopMachineTask());
+ Map<String, Object> stopMachineFlags = MutableMap.of();
+ if (Entitlements.getEntitlementContext() != null) {
+ stopMachineFlags.put("tags",
MutableSet.of(BrooklynTaskTags.tagForEntitlement(Entitlements.getEntitlementContext())));
--- End diff --
Again this feels like a fix for just one situation. Presumably there are
lots of places that have an effector/task that queues sub-tasks. Those other
places may not inherit the EntitlementContext, if we only fix it here.
But saying that, if the DynamicTasks.queue ends up submitting it via
`BasicExecutionContext.submitInternal` then it will happen automatically (I
think).
---
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.
---