[c-c] use subprocess instead of os.system to start repository stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 14 Feb 2012 15:15:09 +0100
branchstable
changeset 8233 9b9180969892
parent 8232 8c29253105ba
child 8234 83fd9ff90a9d
[c-c] use subprocess instead of os.system to start repository
server/serverctl.py
--- a/server/serverctl.py	Tue Feb 14 15:14:40 2012 +0100
+++ b/server/serverctl.py	Tue Feb 14 15:15:09 2012 +0100
@@ -25,6 +25,7 @@
 import sys
 import os
 import logging
+import subprocess
 
 from logilab.common import nullobject
 from logilab.common.configuration import Configuration
@@ -258,12 +259,13 @@
     cfgname = 'repository'
 
     def start_server(self, config):
-        command = ['cubicweb-ctl start-repository ']
+        command = ['cubicweb-ctl', 'start-repository']
         if config.debugmode:
             command.append('--debug')
-        command.append('--loglevel %s' % config['log-threshold'].lower())
+        command.append('--loglevel')
+        command.append(config['log-threshold'].lower())
         command.append(config.appid)
-        os.system(' '.join(command))
+        subprocess.call(command)
         return 1