summaryrefslogtreecommitdiffstats
path: root/py/mock/plugins/tmpfs.py
diff options
context:
space:
mode:
authorMichael E Brown <michael_e_brown@dell.com>2008-01-20 13:30:41 -0600
committerMichael E Brown <michael_e_brown@dell.com>2008-01-20 13:30:41 -0600
commit5aaa59800cae18440c1ba6caca5800e45b3ff5fa (patch)
tree5ff0a59f1718f0afca5bcaa1f88bb9dd383e001c /py/mock/plugins/tmpfs.py
parent7589279b856ae73eb26fc728a38a58edbe06d94c (diff)
downloadmock-5aaa59800cae18440c1ba6caca5800e45b3ff5fa.tar.gz
mock-5aaa59800cae18440c1ba6caca5800e45b3ff5fa.tar.xz
mock-5aaa59800cae18440c1ba6caca5800e45b3ff5fa.zip
convert mock.util.do() to use subprocess.Popen() rather than raw fork/exec.\nThis cleans up the code considerably. Also, start reducing the places where we use a shell in the subcommand.
Diffstat (limited to 'py/mock/plugins/tmpfs.py')
-rw-r--r--py/mock/plugins/tmpfs.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/py/mock/plugins/tmpfs.py b/py/mock/plugins/tmpfs.py
index b3f2d07..cf89bc1 100644
--- a/py/mock/plugins/tmpfs.py
+++ b/py/mock/plugins/tmpfs.py
@@ -40,13 +40,14 @@ class Tmpfs(object):
decorate(traceLog())
def _tmpfsPreInitHook(self):
getLog().info("mounting tmpfs.")
- mountCmd = "mount -n -t tmpfs mock_chroot_tmpfs %s" % self.rootObj.makeChrootPath()
- mock.util.do(mountCmd)
+ mountCmd = ["mount", "-n", "-t", "tmpfs", "mock_chroot_tmpfs",
+ self.rootObj.makeChrootPath()]
+ mock.util.do(mountCmd, shell=False)
decorate(traceLog())
def _tmpfsPostBuildHook(self):
getLog().info("unmounting tmpfs.")
- mountCmd = "umount -n %s" % self.rootObj.makeChrootPath()
- mock.util.do(mountCmd)
+ mountCmd = ["umount", "-n", self.rootObj.makeChrootPath()]
+ mock.util.do(mountCmd, shell=False)