diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-09-01 15:08:49 +0000 |
---|---|---|
committer | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-09-28 10:00:28 +0000 |
commit | 63bb0c9c7edaf3cdaf8d03eb0fbcdbba40b65d36 (patch) | |
tree | 83e10287cf5a6197eb9f96334fa51842cd091574 /morphlib/builder.py | |
parent | 7bfee8e0b73c862c7b447dcfb86b3dab317f24f9 (diff) | |
download | morph-63bb0c9c7edaf3cdaf8d03eb0fbcdbba40b65d36.tar.gz |
Replace cliapp.shell_quote() with pipes.quote()
Replace cliapp.shell_quote() with pipes.quote() to produce the chroot
scripts. Despite pipes.quote() being deprecated, it produces much less
escaping than cliapp.shell_quote(). This method should be replaced with
shlex.quote() when migrating to Python 3.
Change-Id: I4b8e8eefe0cd321458bb3fae72f6d0552680f84f
Diffstat (limited to 'morphlib/builder.py')
-rw-r--r-- | morphlib/builder.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py index a9fe8957..443741b0 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -25,6 +25,7 @@ import traceback import subprocess import tempfile import warnings +import pipes import cliapp @@ -697,7 +698,7 @@ class SystemBuilder(BuilderBase): # pragma: no cover with open(chroot_script, 'w') as f: cmdline = morphlib.util.containerised_cmdline( shell_command, **container_config) - f.write(' '.join(map(cliapp.shell_quote, cmdline))) + f.write(' '.join(map(pipes.quote, cmdline))) with open(logfilepath, 'r') as log: shutil.copyfileobj(log, self.app.output) |