summaryrefslogtreecommitdiff
path: root/systemd
Commit message (Collapse)AuthorAgeFilesLines
* id128: add SD_MESSAGE_TRUNCATED_CORE from upcoming systemd-232Zbigniew Jędrzejewski-Szmek2016-10-172-0/+2
|
* journal: allow stream() to be used without any argumentsZbigniew Jędrzejewski-Szmek2016-10-171-3/+12
| | | | | | | | | It's fairly easy to provide a reasonable default for the first argument. Let's do that. Also, the documentation was misleading, suggesting that the function itself can be passed as file parameter to print(). Use a different name for the temporary variable to clarify that.
* journal: bump default log level for stream() to INFOZbigniew Jędrzejewski-Szmek2016-10-171-1/+1
| | | | | By default debug messages are ignored, and INFO should be used for "normal" messages.
* _reader: use proper ifdef guard for sd_j_open_files_fdZbigniew Jędrzejewski-Szmek2016-09-221-3/+7
|
* tests: add workaround for pre-232 system returning EINVAL on some flagsZbigniew Jędrzejewski-Szmek2016-09-221-5/+15
|
* docs: fix sphinx format warningZbigniew Jędrzejewski-Szmek2016-09-221-3/+3
| | | | build/lib.linux-x86_64-3.5/systemd/journal.py:docstring of systemd.journal.stream:15: WARNING: Literal block expected; none found.
* tests: skip fdstore tests if not implementedZbigniew Jędrzejewski-Szmek2016-09-221-3/+15
| | | | Should fix #12.
* Store id128-constants.h in the repositoryZbigniew Jędrzejewski-Szmek2016-09-214-2/+92
| | | | | | | | | | | | | | Instead of generating the list of message ids anew during every build, the file is generated manually and committed into the repository. Also, the list of defines is stored in id128-defines.h, also kept in the repository. Both files should only grow. This should make build easier. But it also fixes a problem with systemd, which occasionally drops message definitions. We will keep them forever, so it should be safe to rely on the presence of message definitions which systemd does not use anymore. Fixes #23.
* journal: convert seek_realtime argument to microsecondsZbigniew Jędrzejewski-Szmek2016-09-212-7/+32
| | | | | | | | | | | | | This somewhat breaks backwards compatibility, but not for the previously documented arguments: floats are now interpreted differently, but ints and datetime.datetime objects are interpreted the same as before. But the documentation clearly stated that only ints and datetime.datetime objects were allowed. This makes seek_realtime match seek_monotonic and other functions which take time and follows the principle of least surprise. Fixes #21.
* tests: use a context manager, skip new functions if missingZbigniew Jędrzejewski-Szmek2016-09-211-21/+16
|
* reader: add SD_JOURNAL_OS_ROOT and rework flag passingZbigniew Jędrzejewski-Szmek2016-09-213-24/+50
| | | | | | | | | | | | | | | | | Let's pass any flags through to the journal functions without checking validity. Those functions do their own checking, so there's no need to second-guess. The semantics for _Reader(flags=0) are a bit changed: before, this would be transformed into sd_journal_open(SD_J_LOCAL_ONLY). Now, this results in sd_journal_open(0). Previous behaviour should be achieved by not specifying the flags at all. This change is necessary, because previously it was not possible to pass flags=0 to sd_journal_open(0), i.e. it was not possible to "merge" journals through the Python interface. Similarly, Reader(flags=0) now means to open all journals, and Reader(flags=None) is the same as Reader(flags=LOCAL_ONLY).
* journal: add support for sd_journal_open_files_fdZbigniew Jędrzejewski-Szmek2016-09-211-15/+81
|
* journal: make sd_journal_enumerate return text stringsZbigniew Jędrzejewski-Szmek2016-09-211-1/+1
| | | | | Those are field names and they should always be ASCII, and converting them to str automatically makes the answer more useful.
* journal: allow sd_journal_open_directory_fd to be usedZbigniew Jędrzejewski-Szmek2016-09-213-53/+125
|
* Reformat documentation to be more PEP257-compliantZbigniew Jędrzejewski-Szmek2016-09-202-125/+137
| | | | | | | | | | Wrapping the sources to ~80 columns means that the formatted output is annoying to read. Rewrap to ~74 columns in the output. Also remove some obsolete descritions of journal permissions and refer to journalctl(1) instead. Add some missing docstrings.
* tests: check enumerate_fields, has_runtime_fiels, has_persistent_filesZbigniew Jędrzejewski-Szmek2016-09-201-0/+47
|
* journal: add wrappers for sd_has_*_filesZbigniew Jędrzejewski-Szmek2016-09-201-31/+77
|
* journal: add wrapper for sd_journal_enumerateZbigniew Jędrzejewski-Szmek2016-09-201-31/+79
|
* journal: check errors properly in query_uniqueZbigniew Jędrzejewski-Szmek2016-09-201-5/+20
|
* Fix typo (#26)Michael Biebl2016-07-161-1/+1
|
* Use log.warning instead of deprecated log.warn in example codeVille Skyttä2016-05-211-2/+2
|
* Spelling fixesVille Skyttä2016-05-211-2/+2
|
* test_daemon: Define a default value for SO_PASSCREDMike Gilbert2016-01-201-1/+3
| | | | The socket module seems to be missing this in python2.7.
* Fixes Reader.seek_monotonic(datetime.timedelta)Michael Herold2015-12-101-1/+1
|
* reader: avoid gcc warningZbigniew Jędrzejewski-Szmek2015-12-021-1/+1
| | | | | | | gcc warns that r might be uninitialized, because it doesn't know that r will be initialized in the 'if' statement. Initialize the variable to avoid the warning.
* tests: mirror is-systemd-running test from systemdv231Zbigniew Jędrzejewski-Szmek2015-10-281-1/+1
|
* Python2 does not have ConnectionErrorZbigniew Jędrzejewski-Szmek2015-10-271-5/+10
|
* tests: add tests for notify()Zbigniew Jędrzejewski-Szmek2015-10-261-1/+36
|
* daemon: wrap sd_pid_notify[_with_pids]Zbigniew Jędrzejewski-Szmek2015-10-262-10/+79
| | | | Closes #8.
* Merge branch 'tests'Zbigniew Jędrzejewski-Szmek2015-10-253-165/+471
|\
| * tests: work around bug in sd_is_mqZbigniew Jędrzejewski-Szmek2015-10-251-3/+20
| | | | | | | | The fix was committed in v226-362-g0260d1d542.
| * Do not assume specific output from the journalZbigniew Jędrzejewski-Szmek2015-10-251-2/+1
| | | | | | | | | | While we *usually* get those messages from udev, in many tests environments this will not be true, so just do not try to check the output at all.
| * tests: add simplistic tests for Reader matchesZbigniew Jędrzejewski-Szmek2015-09-161-1/+33
| | | | | | | | | | | | | | It would be nice to run those tests against fake journal files with the right content to actually test the matches. But those tests are still useful because they test that the interface works as expected.
| * journal: allow numbers in field identifiersZbigniew Jędrzejewski-Szmek2015-09-171-2/+2
| |
| * tests: add tests for Reader initializationZbigniew Jędrzejewski-Szmek2015-09-172-1/+40
| |
| * journal: reindent to 4 spacesZbigniew Jędrzejewski-Szmek2015-09-171-158/+156
| |
| * tests: start adding tests for JournalHandlerZbigniew Jędrzejewski-Szmek2015-09-171-0/+34
| |
| * Normalize some strange indentationZbigniew Jędrzejewski-Szmek2015-09-081-7/+8
| |
| * tests: add more tests for socket functionsZbigniew Jędrzejewski-Szmek2015-09-061-1/+85
| |
| * tests: adapt to python2.7 output againZbigniew Jędrzejewski-Szmek2015-09-051-3/+2
| |
| * tests: daemon.bootedZbigniew Jędrzejewski-Szmek2015-09-051-1/+9
| |
| * tests: daemon.listen_fdsZbigniew Jędrzejewski-Szmek2015-09-051-1/+26
| |
| * tests: enable doctests in the sourcesZbigniew Jędrzejewski-Szmek2015-09-051-6/+12
| | | | | | | | | | | | | | | | | | Unfortunately the "standard" way to access the names in the defined module does not work. I find it nicer to explicitly import, e.g. from systemd import journal, because then the examples correspond more closely to what a user would use. The only exception is made for JournalHandler, because journal.JournalHandler is a tad to long.
| * tests: add first testZbigniew Jędrzejewski-Szmek2015-08-071-0/+64
| | | | | | | | | | This is based on the code in https://github.com/systemd/python-systemd/pull/4 by Jacek Konieczny <j.konieczny@eggsoft.pl>.
* | Fix booted() docEvgeny Vereshchagin2015-09-041-1/+1
| |
* | Add compatibility with systemd < 205Zbigniew Jędrzejewski-Szmek2015-09-041-2/+13
|/
* tree-wide: systemd→python-systemd in headersZbigniew Jędrzejewski-Szmek2015-08-0712-36/+36
|
* Fix daemon.is_fifo and .is_mq under Python 3Jacek Konieczny2015-08-071-2/+8
| | | | | | | The 'path' parameter was not properly converted from Unicode and the functions would always fail when a path was provided. https://github.com/systemd/python-systemd/pull/4
* Move docs to top level and include in manifestZbigniew Jędrzejewski-Szmek2015-07-089-665/+0
|
* Update LICENSE file and classifiersZbigniew Jędrzejewski-Szmek2015-07-0512-12/+0
| | | | | | The license was originally MIT, but when this module became part of systemd, it was changed to LGPLv2+. All files had correct headers, so only the LICENSE file needs updating. Take the opportunity to add classifiers to setup.py.