Skip to content

Commit 942f79d

Browse files
committed
Polishing run_cli_process calls
1 parent 168217c commit 942f79d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mbed_lstools/lstools_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ def scan_html_line_for_target_id(self, line):
577577
return result
578578
return None
579579

580+
@staticmethod
580581
def run_cli_process(cmd, shell=True):
581582
"""! Runs command as a process and return stdout, stderr and ret code
582583
@param cmd Command to execute

mbed_lstools/lstools_linux_generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_dev_by_id_cmd(self, subdir):
127127
"""
128128
cmd = 'ls -oA /dev/' + subdir + '/by-id/'
129129
_stdout, _, retval = self.run_cli_process(cmd)
130-
return (_stdout, retval)
130+
return (_stdout.splitlines(), retval)
131131

132132
def get_dev_by_id_process(self, lines, retval):
133133
"""! Remove unnecessary lines from command line output
@@ -163,7 +163,7 @@ def get_mounts(self):
163163
_stdout, _, retval = self.run_cli_process(cmd)
164164

165165
if not retval:
166-
for line in _stdout.readlines():
166+
for line in _stdout.splitlines():
167167
line = line.rstrip()
168168
result.append(line)
169169
if self.DEBUG_FLAG:

0 commit comments

Comments
 (0)