From 198810105ad4d51a9708035e0bc1e32a7a2747f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 4 May 2018 17:25:23 +0200 Subject: [PATCH] fix: change directory --- mail_to_misp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mail_to_misp.py b/mail_to_misp.py index 33a1aae..74eba48 100755 --- a/mail_to_misp.py +++ b/mail_to_misp.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import os import sys import argparse import re @@ -329,6 +330,8 @@ if __name__ == '__main__': syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_USER) syslog.syslog("Job started.") + os.chdir(Path(__file__).cwd()) + configmodule = Path(__file__).name.replace('.py', '_config') if Path(f'{configmodule}.py').exists(): config = importlib.import_module(configmodule)