Skip to content

Commit

Permalink
inherit tags for canned_actions
Browse files Browse the repository at this point in the history
Thanks to canned action, it is very easy to create dependency errors
with code like this:

```
svc_systemd = {
    'test.service': {
        'tags': {'a'},
        'needed_by': {'!tag:a'},
    },
}
```

Therefore canned actions should inherit the tags of their parent
actions to avoid confisions by using the `!tag:foobar` selector.
  • Loading branch information
rossmeier committed Jan 31, 2022
1 parent 5a47727 commit 79031f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bundlewrap/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ def _inject_canned_actions(items):
for item in items:
for canned_action_name, canned_action_attrs in item.get_canned_actions().items():
canned_action_id = f"{item.id}:{canned_action_name}"
canned_action_attrs.update({'triggered': True})
canned_action_attrs.update({
'triggered': True,
'tags': item.tags,
})
action = Action(
item.bundle,
canned_action_id,
Expand Down

0 comments on commit 79031f2

Please sign in to comment.