Skip to content

Commit

Permalink
refactor: Make event scope required in stages.py (#4674)
Browse files Browse the repository at this point in the history
All call points include a scope, so for the time being, it makes no
sense to allow for None.
  • Loading branch information
TheRealFalcon committed Dec 8, 2023
1 parent da62f29 commit a6ef369
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cloudinit/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def update_event_enabled(
datasource: sources.DataSource,
cfg: dict,
event_source_type: EventType,
scope: Optional[EventScope] = None,
scope: EventScope,
) -> bool:
"""Determine if a particular EventType is enabled.
Expand Down Expand Up @@ -93,11 +93,7 @@ def update_event_enabled(
)
LOG.debug("Allowed events: %s", allowed)

scopes: Iterable[EventScope]
if not scope:
scopes = allowed.keys()
else:
scopes = [scope]
scopes: Iterable[EventScope] = [scope]
scope_values = [s.value for s in scopes]

for evt_scope in scopes:
Expand Down

0 comments on commit a6ef369

Please sign in to comment.