Skip to content

Commit 4233a82

Browse files
committed
fixed docstrings
1 parent d902dec commit 4233a82

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

nodescraper/plugins/inband/dmesg/collector_args.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,10 @@
2828

2929

3030
class DmesgCollectorArgs(CollectorArgs):
31+
"""Collector args
32+
33+
Args:
34+
CollectorArgs (CollectorArgs): specific dmesg collector args
35+
"""
36+
3137
collect_logs: bool = False

nodescraper/plugins/inband/dmesg/dmesg_collector.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,25 @@ class DmesgCollector(InBandDataCollector[DmesgData, None]):
4949
)
5050

5151
def _shell_quote(self, s: str) -> str:
52-
"""single-quote fix."""
52+
"""Single quote fix
53+
54+
Args:
55+
s (str): path to be converted
56+
57+
Returns:
58+
str: path to be returned
59+
"""
5360
return "'" + s.replace("'", "'\"'\"'") + "'"
5461

5562
def _nice_dmesg_name(self, path: str) -> str:
56-
"""Map path to filename."""
63+
"""Map path to filename
64+
65+
Args:
66+
path (str): path of remote file
67+
68+
Returns:
69+
str: filename for local file
70+
"""
5771
base = path.rstrip("/").rsplit("/", 1)[-1]
5872
if base == "dmesg":
5973
return "dmesg_log.log"
@@ -66,7 +80,8 @@ def _nice_dmesg_name(self, path: str) -> str:
6680

6781
return (base[:-3] if base.endswith(".gz") else base) + ".log"
6882

69-
def _collect_dmesg_rotations(self) -> int:
83+
def _collect_dmesg_rotations(self):
84+
"""Collect dmesg logs"""
7085
list_res = self._run_sut_cmd(self.DMESG_LOGS_CMD, sudo=True)
7186
paths = [p.strip() for p in (list_res.stdout or "").splitlines() if p.strip()]
7287
if not paths:

0 commit comments

Comments
 (0)