Skip to content

Commit a674943

Browse files
committed
The jobs should be optionally set.
Signed-off-by: Pedro Algarvio <[email protected]>
1 parent 44bc041 commit a674943

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/saf/process/job_aggregate.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from typing import Set
1515
from typing import Type
1616

17+
from pydantic import Field
18+
1719
from saf.collect.event_bus import EventBusCollectedEvent
1820
from saf.collect.grains import GrainsCollectedEvent
1921
from saf.models import CollectedEvent
@@ -32,7 +34,7 @@ class JobAggregateConfig(ProcessConfigBase):
3234
Job aggregate collector configuration.
3335
"""
3436

35-
jobs: Set[str]
37+
jobs: Set[str] = Field(default_factory=set)
3638

3739

3840
def get_config_schema() -> Type[JobAggregateConfig]:
@@ -74,7 +76,10 @@ async def process(
7476
jid = tag.split("/")[2]
7577
# We will probably want to make this condition configurable
7678
salt_func = data.get("fun", "")
77-
for func_filter in ctx.config.jobs:
79+
matching_jobs = ctx.config.jobs
80+
if not matching_jobs:
81+
matching_jobs.add("*")
82+
for func_filter in matching_jobs:
7883
if fnmatch.fnmatch(salt_func, func_filter):
7984
if jid not in ctx.cache["watched_jids"]:
8085
ctx.cache["watched_jids"][jid] = {

0 commit comments

Comments
 (0)