[server] fix db-dump with sqlite
'gzip -c dbname > backupfile' needs to go through the shell.
--- a/server/sqlutils.py Tue Nov 03 15:54:46 2015 +0100
+++ b/server/sqlutils.py Tue Nov 03 15:55:35 2015 +0100
@@ -47,8 +47,12 @@
SQL_PREFIX = 'cw_'
def _run_command(cmd):
- print(' '.join(cmd))
- return subprocess.call(cmd)
+ if isinstance(cmd, string_types):
+ print(cmd)
+ return subprocess.call(cmd, shell=True)
+ else:
+ print(' '.join(cmd))
+ return subprocess.call(cmd)
def sqlexec(sqlstmts, cursor_or_execute, withpb=True,