Filepath over ssh should be wrapped in qoutes.

This is relevant for files with spaces or special characters that we
want interpreted as a single parameter.
This commit is contained in:
2023-08-26 10:52:13 +02:00
parent 42f909a251
commit 0cad37f67f

View File

@@ -45,10 +45,10 @@ class File():
def fileSize(self): def fileSize(self):
filePath = self.system.buildFilePath(self) filePath = self.system.buildFilePath(self)
cmd = "du -hs '{}'".format(filePath.replace(' ', '\\ ')) cmd = "du -hs '{}'".format(filePath)
if self.system.remote: if self.system.remote:
cmd = 'ssh {}@{} {}'.format(self.system.user, self.system.host, cmd) cmd = 'ssh {}@{} "{}"'.format(self.system.user, self.system.host, cmd)
diskusageOutput = check_output(cmd, shell=True) diskusageOutput = check_output(cmd, shell=True)