From 44e3496bd1a3004bc7a6497cbd212bba7910b2e3 Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Fri, 9 Jun 2017 14:34:10 +0200 Subject: [PATCH] ipatests: do not collect systemd journal when logfile_dir is missing If logs aren't collected to logfile_dir, skip collection of systemd journal. Related https://pagure.io/freeipa/issue/6971 Signed-off-by: Tomas Krizek Reviewed-By: Martin Basti Reviewed-By: Alexander Bokovoy --- ipatests/pytest_plugins/integration/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ipatests/pytest_plugins/integration/__init__.py b/ipatests/pytest_plugins/integration/__init__.py index 20e60e919..6191c663b 100644 --- a/ipatests/pytest_plugins/integration/__init__.py +++ b/ipatests/pytest_plugins/integration/__init__.py @@ -82,6 +82,9 @@ def collect_systemd_journal(node, hosts, test_config): name = _get_logname_from_node(node) logfile_dir = test_config.getoption('logfile_dir') + if logfile_dir is None: + return + for host in hosts: log.info("Collecting journal from: %s", host.hostname)