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 Feb 21, 2021
1 parent 4427b26 commit 4435023
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 @@ -154,7 +154,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 4435023

Please sign in to comment.