Skip to content

Commit 3254994

Browse files
committed
removed extra decode
1 parent 0d9625c commit 3254994

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

nodescraper/connection/inband/inbandlocal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def run_command(
5656
command,
5757
encoding="utf-8",
5858
shell=True,
59+
errors="replace",
5960
timeout=timeout,
6061
capture_output=True,
6162
check=False,

nodescraper/plugins/inband/journal/journal_collector.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
# SOFTWARE.
2424
#
2525
###############################################################################
26-
import base64
2726

2827
from nodescraper.base import InBandDataCollector
2928
from nodescraper.enums import EventCategory, EventPriority, ExecutionStatus, OSFamily
@@ -44,7 +43,7 @@ def _read_with_journalctl(self):
4443
Returns:
4544
str|None: system journal read
4645
"""
47-
cmd = "journalctl --no-pager --system --all --output=short-iso 2>&1 | base64 -w0"
46+
cmd = "journalctl --no-pager --system --output=short-iso"
4847
res = self._run_sut_cmd(cmd, sudo=True, log_artifact=False, strip=False)
4948

5049
if res.exit_code != 0:
@@ -59,16 +58,7 @@ def _read_with_journalctl(self):
5958
self.result.status = ExecutionStatus.ERROR
6059
return None
6160

62-
if isinstance(res.stdout, (bytes, bytearray)):
63-
b64 = (
64-
res.stdout if isinstance(res.stdout, str) else res.stdout.decode("ascii", "ignore")
65-
)
66-
raw = base64.b64decode("".join(b64.split()))
67-
text = raw.decode("utf-8", errors="replace")
68-
else:
69-
text = res.stdout
70-
71-
return text
61+
return res.stdout
7262

7363
def collect_data(self, args=None) -> tuple[TaskResult, JournalData | None]:
7464
"""Collect journal logs

0 commit comments

Comments
 (0)