Skip to content

Commit 28e4319

Browse files
committed
updated failure case
1 parent bca73c0 commit 28e4319

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

nodescraper/plugins/inband/journal/journal_collector.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#
2525
###############################################################################
2626
from nodescraper.base import InBandDataCollector
27-
from nodescraper.enums import OSFamily
27+
from nodescraper.enums import EventCategory, EventPriority, ExecutionStatus, OSFamily
2828
from nodescraper.models import TaskResult
2929

3030
from .journaldata import JournalData
@@ -47,6 +47,16 @@ def _read_with_journalctl(self):
4747

4848
if res.exit_code == 0:
4949
return res.stdout
50+
else:
51+
self._log_event(
52+
category=EventCategory.OS,
53+
description="Error reading journalctl",
54+
data={"command": res.command, "exit_code": res.exit_code},
55+
priority=EventPriority.ERROR,
56+
console_log=True,
57+
)
58+
self.result.message = "Could not read journalctl data"
59+
self.result.status = ExecutionStatus.ERROR
5060

5161
return None
5262

0 commit comments

Comments
 (0)