1. Thomas Waldmann
  2. rsync_backup


rsync_backup / fs.py

Diff from to

File fs.py

  • Ignore whitespace
 import os
 import errno
-from subprocess import check_call as cmd
+from exec_cmd import exec_shell as cmd
 def make_dir(path):
 def mount(src, mountpoint):
     """mount src on mountpoint"""
-    cmd("mount %(src)s %(mountpoint)s" % dict(src=src, mountpoint=mountpoint),
-        shell=True)
+    cmd("mount %(src)s %(mountpoint)s" % dict(src=src, mountpoint=mountpoint))
     # TODO: check if mount succeeded with os.path.ismount(mountpoint)
 def umount(mountpoint):
     """umount mountpoint"""
-    cmd("umount %(mountpoint)s" % dict(mountpoint=mountpoint),
-        shell=True)
+    cmd("umount %(mountpoint)s" % dict(mountpoint=mountpoint))
 def _process_pathes(command, pathes, dst_path, root_path="/", **kw):
     for path in pathes:
         dst = os.path.join(dst_path, path[prefix_len:])
-        cmd(command % dict(src=path, dst=dst), shell=True)
+        cmd(command % dict(src=path, dst=dst))
 def mount_pathes(pathes, dst_path, root_path="/", **kw):