server/sqlutils.py
changeset 4314 e12ee4a009bc
parent 4252 6c4f109c2b03
parent 4298 2ca56131079e
child 4322 f65743cc53e4
--- a/server/sqlutils.py	Thu Jan 21 11:02:36 2010 +0100
+++ b/server/sqlutils.py	Thu Jan 21 11:08:41 2010 +0100
@@ -8,6 +8,7 @@
 __docformat__ = "restructuredtext en"
 
 import os
+import subprocess
 from os.path import exists
 from warnings import warn
 from datetime import datetime, date, timedelta
@@ -173,7 +174,7 @@
         cmd = self.dbhelper.backup_command(self.dbname, self.dbhost,
                                            self.dbuser, backupfile,
                                            keepownership=False)
-        if os.system(cmd):
+        if subprocess.call(cmd):
             raise Exception('Failed command: %s' % cmd)
 
     def restore_from_file(self, backupfile, confirm, drop=True):
@@ -182,7 +183,7 @@
                                                   self.encoding,
                                                   keepownership=False,
                                                   drop=drop):
-            if os.system(cmd):
+            if subprocess.call(cmd):
                 print '-> Failed command: %s' % cmd
                 if not confirm('Continue anyway?', default='n'):
                     raise Exception('Failed command: %s' % cmd)