amend, obtain argument namespace before we'll use it

pull/3927/merge
sebres 2025-03-31 01:11:05 +02:00
parent b2352f113e
commit 6b56259f9a
1 changed files with 5 additions and 5 deletions

View File

@ -141,6 +141,11 @@ class FilterSystemd(JournalFilter): # pragma: systemd no cover
elif rotated:
args['flags'] = journal.SYSTEM_ONLY
try:
args['namespace'] = kwargs.pop('namespace')
except KeyError:
pass
# To avoid monitoring rotated logs, as prevention against "Too many open files",
# set the files to system.journal and user-*.journal (without rotated *@*.journal):
if not rotated and not args.get('files') and not args.get('namespace'):
@ -152,11 +157,6 @@ class FilterSystemd(JournalFilter): # pragma: systemd no cover
else:
args['files'] = None
try:
args['namespace'] = kwargs.pop('namespace')
except KeyError:
pass
return args
@property