Skip to content

Commit

Permalink
Separate command arguments from name
Browse files Browse the repository at this point in the history
In order to execute commands, subprocess.Popen expects a list of
strings, where the first one represents the name of the command and the
remaining strings are the command’s arguments. However, the -s option
was included in the name of the binary, which isn’t supported in newer
versions of	Python anymore.

Co-authored-by: Milos Svasek <[email protected]>
  • Loading branch information
pluehne and svasek committed Mar 3, 2022
1 parent d7cf435 commit 2de4817
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion updater/reports/Report.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def executeScript(self, script, stdin = None):
except:
# If the script is a list of strings, then escape the content and set it to stdin
stdin = " ".join(map(lambda x: '"' + x.replace('\\"', '\\\\"').replace('"', '\\"') + '"', script))
script = ["bash -s", "--"]
script = ["bash", "-s", "--"]

# Execute the script via SSH
script = [
Expand Down

0 comments on commit 2de4817

Please sign in to comment.