fix test config file location and paths

This commit is contained in:
Bastian Schroll 2019-03-03 13:54:14 +01:00
parent 2ca62d90f2
commit 4b69b08028
7 changed files with 45 additions and 38 deletions

View file

@ -50,7 +50,7 @@ class ConfigYAML:
except FileNotFoundError:
logging.error("config file not found: %s", configPath)
except yaml.parser.ParserError:
logging.exception("error in config file")
logging.exception("syntax error in config file: %s", configPath)
return False
def get(self, *args, default=None):

View file

@ -17,25 +17,13 @@
import logging
import os
import sys
import platform
logging.debug("- %s loaded", __name__)
# note searching for root part is not a nice solution atm
ROOT_PATH = os.path.dirname(sys.modules['boswatch'].__file__).replace("\\", "/") + "/../"
# implements a system adaption for the paths
if platform.system() == "Linux":
LOG_PATH = "/var/log/boswatch/"
CONFIG_PATH = "/etc/opt/boswatch/"
else:
# FIXME LOG_PATH not used actually
# path is fixed in logger config.ini
LOG_PATH = ROOT_PATH + "log/"
CONFIG_PATH = ROOT_PATH + "config/"
PLUGIN_PATH = ROOT_PATH + "plugin/"
CSV_PATH = ROOT_PATH + "csv/"
CONFIG_PATH = ROOT_PATH + "config/"
BIN_PATH = ROOT_PATH + "_bin/"
TEST_PATH = ROOT_PATH + "test/"