Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few small fixes in cysystemd.reader #61

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cysystemd/reader.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ from datetime import datetime, timezone
from uuid import UUID
from contextlib import contextmanager
from errno import errorcode
from enum import IntEnum
from enum import IntEnum, IntFlag


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -135,7 +135,7 @@ def check_error_code(int code):



class JournalOpenMode(IntEnum):
class JournalOpenMode(IntFlag):
LOCAL_ONLY = SD_JOURNAL_LOCAL_ONLY
RUNTIME_ONLY = SD_JOURNAL_RUNTIME_ONLY
SYSTEM = SD_JOURNAL_SYSTEM
Expand Down Expand Up @@ -245,9 +245,7 @@ cdef class JournalEntry:

self._data = self.__data
self.__boot_uuid = UUID(bytes=self.__boot_id.bytes[:16])
date = datetime.utcfromtimestamp(self.get_realtime_sec())
date.replace(tzinfo=timezone.utc)
self.__date = date
self.__date = datetime.fromtimestamp(self.get_realtime_sec(), timezone.utc)

@property
def cursor(self):
Expand All @@ -267,8 +265,9 @@ cdef class JournalEntry:
cpdef uint64_t get_monotonic_usec(self):
return self.monotonic_usec

@property
def boot_id(self):
return self.boot_id
return self.__boot_uuid

@property
def date(self):
Expand Down