Skip to content

Commit 1dd763f

Browse files
committed
driver/usbstoragedriver: wrap commands
Use the wrap_command() function to escape command arguments in case a remote operation over SSH is done. Fixes #1392 Alternative to #1450 Signed-off-by: Rouven Czerwinski <[email protected]>
1 parent c3a2b67 commit 1dd763f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

labgrid/driver/usbstoragedriver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def write_files(self, sources, target, partition, target_is_directory=True):
113113

114114
args = ["cp", "-T", copied_sources[0], target_path]
115115

116-
processwrapper.check_output(self.storage.command_prefix + args)
116+
processwrapper.check_output(self.storage.wrap_command(args))
117117
self.proxy.unmount(self.devpath)
118118
except:
119119
# We are going to die with an exception anyway, so no point in waiting
@@ -231,7 +231,7 @@ def get_size(self, partition=None):
231231
"""
232232
args = ["cat", f"/sys/class/block/{self._get_devpath(partition)[5:]}/size"]
233233
try:
234-
size = subprocess.check_output(self.storage.command_prefix + args)
234+
size = subprocess.check_output(self.storage.wrap_command(args))
235235
except subprocess.CalledProcessError:
236236
# while the medium is getting ready, the file does not yet exist
237237
return 0

0 commit comments

Comments
 (0)