summaryrefslogtreecommitdiff
path: root/systemd/journal.py
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-07 11:28:44 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-05 14:19:17 -0400
commit67bdb044d89e04ee9e71741b20f797bb32458b32 (patch)
tree9ebbd4cedb182330b93480ecdd1400009ef6cc99 /systemd/journal.py
parent000525db3e22d76131adbb17bc87b1c7c6426481 (diff)
downloadpython-systemd-67bdb044d89e04ee9e71741b20f797bb32458b32.tar.gz
systemd-python: refuse path and flags together in __init__
It's better to explictly check, instead of just documenting it. The return value from init is changed from 1 to -1 on error. Python seems to ignore 1 every second time. Looks like a bug in Python, but the return value doesn't seem to be documented anywhere, and -1 works as expected... so let's just use that.
Diffstat (limited to 'systemd/journal.py')
-rw-r--r--systemd/journal.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/systemd/journal.py b/systemd/journal.py
index e9c09e8..1ed726c 100644
--- a/systemd/journal.py
+++ b/systemd/journal.py
@@ -114,7 +114,7 @@ class Reader(_Reader):
See systemd.journal-fields(7) for more info on typical fields
found in the journal.
"""
- def __init__(self, flags=LOCAL_ONLY, path=None, converters=None):
+ def __init__(self, flags=0, path=None, converters=None):
"""Create an instance of Reader, which allows filtering and
return of journal entries.
@@ -125,8 +125,7 @@ class Reader(_Reader):
journal files of system services and the kernel.
Argument `path` is the directory of journal files. Note that
- currently flags are ignored when `path` is present as they are
- currently not relevant.
+ `flags` and `path` are exclusive.
Argument `converters` is a dictionary which updates the
DEFAULT_CONVERTERS to convert journal field values. Field