amend to 7520d250b0 (#2444): don't use default flags (SYSTEM) if journalfiles are specified (similar journalflags set to 0);

fix failure of testJournalFilesArg and cover both cases now.
pull/2517/head
sebres 2019-07-29 14:13:30 +02:00
parent 19052d9789
commit 39d9133baa
2 changed files with 8 additions and 1 deletions

View File

@ -91,7 +91,9 @@ class FilterSystemd(JournalFilter): # pragma: systemd no cover
try:
args['flags'] = int(kwargs.pop('journalflags'))
except KeyError:
args['flags'] = 4
# be sure all journal types will be opened if files specified (don't set flags):
if 'files' not in args or not len(args['files']):
args['flags'] = 4
return args

View File

@ -1280,6 +1280,11 @@ def get_monitor_failures_journal_testcase(Filter_): # pragma: systemd no cover
jrnlfile = self._getRuntimeJournal()
self._initFilter(journalfiles=jrnlfile)
def testJournalFilesAndFlagsArgs(self):
# retrieve current system journal path
jrnlfile = self._getRuntimeJournal()
self._initFilter(journalfiles=jrnlfile, journalflags=0)
def testJournalPathArg(self):
# retrieve current system journal path
jrnlpath = self._getRuntimeJournal()