Remove the dependency on python-systemd

This commit is contained in:
mprahl
2018-03-23 09:17:48 -04:00
parent ea1fc93325
commit bed9bf7a87
3 changed files with 3 additions and 14 deletions

1
Vagrantfile vendored
View File

@@ -35,7 +35,6 @@ $script = <<SCRIPT
redhat-rpm-config \
rpm-build \
swig \
systemd-devel \
https://kojipkgs.fedoraproject.org//packages/libmodulemd/1.1.3/1.fc27/x86_64/libmodulemd-1.1.3-1.fc27.x86_64.rpm
cd /opt/module_build_service
python setup.py develop

View File

@@ -62,8 +62,8 @@ class BaseConfiguration(object):
# 'modularity-wg',
])
# Available backends are: console, file, journal.
LOG_BACKEND = 'journal'
# Available backends are: console and file
LOG_BACKEND = 'console'
# Path to log file when LOG_BACKEND is set to "file".
LOG_FILE = 'module_build_service.log'

View File

@@ -163,7 +163,7 @@ def str_to_log_level(level):
def supported_log_backends():
return ("console", "journal", "file")
return ("console", "file")
def init_logging(conf):
@@ -176,16 +176,6 @@ def init_logging(conf):
logging.basicConfig(level=conf.log_level, format=log_format)
log = logging.getLogger()
log.setLevel(conf.log_level)
elif log_backend == "journal":
logging.basicConfig(level=conf.log_level, format=log_format)
try:
from systemd import journal
except Exception:
raise ValueError("systemd.journal module is not installed")
log = logging.getLogger()
log.propagate = False
log.addHandler(journal.JournalHandler())
else:
logging.basicConfig(filename=conf.log_file, level=conf.log_level,
format=log_format)