Skip to content

Commit a2edf45

Browse files
committed
fix: conditionally pass __file__ to Job initialization based on bunkerweb version
1 parent 8ac48a6 commit a2edf45

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

crowdsec/jobs/crowdsec-conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
sys_path.append(deps_path)
1313

1414
from jinja2 import Environment, FileSystemLoader
15+
from common_utils import get_version # type: ignore
1516
from logger import setup_logger # type: ignore
1617
from jobs import Job # type: ignore
1718

@@ -36,7 +37,11 @@
3637
LOGGER.info("CrowdSec is not activated, skipping job...")
3738
sys_exit(status)
3839

39-
JOB = Job(LOGGER, __file__)
40+
bunkerweb_version = get_version()
41+
if int(bunkerweb_version.split(".")[1]) < 6:
42+
JOB = Job(LOGGER)
43+
else:
44+
JOB = Job(LOGGER, __file__)
4045

4146
# Generate content
4247
jinja_env = Environment(loader=FileSystemLoader(PLUGIN_PATH.joinpath("misc")))

0 commit comments

Comments
 (0)