server/sqlutils.py
branchstable
changeset 4298 2ca56131079e
parent 4212 ab6573088b4a
child 4314 e12ee4a009bc
child 4416 94a3a2dec8fc
--- a/server/sqlutils.py	Wed Dec 16 14:19:01 2009 +0100
+++ b/server/sqlutils.py	Wed Jan 20 09:00:36 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)