提交 a184a0ac 编写于 作者: C Cleber Rosa

Journal plugin: only attempt to close it if it has been initialized

Attempting to close a journal that wasn't initialized is certainly a
bug.  This will check for its initialization first.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 1ac34e5a
......@@ -70,7 +70,8 @@ class JournalResult(ResultEvents):
self.journal_initialized = True
def _shutdown_journal(self):
self.journal.close()
if self.journal_initialized:
self.journal.close()
def _record_job_info(self, state):
res = self.journal_cursor.execute("SELECT unique_id FROM job_info")
......
......@@ -479,6 +479,9 @@ class OutputPluginTest(unittest.TestCase):
self.assertNotIn("RESULTS : PASS ", result.stdout)
self.assertNotIn("JOB TIME :", result.stdout)
# Check that plugins do not produce errors
self.assertNotIn("Error running method ", result.stderr)
def tearDown(self):
shutil.rmtree(self.tmpdir)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册