[_modules] add pyramid option to start
authorArthur Lutz <arthur.lutz@logilab.fr>
Thu, 11 Feb 2016 14:29:17 +0100
changeset 67 7874ed3fe201
parent 66 52f94ff67a77
child 68 448139f2bee5
[_modules] add pyramid option to start
_modules/cubicweb.py
--- a/_modules/cubicweb.py	Tue Jan 26 10:48:51 2016 +0100
+++ b/_modules/cubicweb.py	Thu Feb 11 14:29:17 2016 +0100
@@ -49,15 +49,24 @@
     '''
     return __salt__['cmd.run']('cubicweb-ctl version').split("\n")[0]
 
-def start(name):
+def start(name, pyramid=False):
     '''
     Start a Cubicweb instance 
 
+    name:
+       name of the instance to start
+    pyramid:
+       start using pyramid, not cubicweb legacy (default to False)
+
     CLI Example::
 
         salt '*' cubicweb.start myinstance
+        salt '*' cubicweb.start new_instance pyramid=True
     '''
-    start_cmd = __salt__['cmd.run']('cubicweb-ctl start {0}'.format(name))
+    if pyramid:
+        start_cmd = __salt__['cmd.run']('cubicweb-ctl pyramid {0}'.format(name))
+    else:
+        start_cmd = __salt__['cmd.run']('cubicweb-ctl start {0}'.format(name))
     log.debug('start {0}: {1!r}'.format(name, start_cmd))
     # TODO use force-restart when implemented 
     if '--force' in start_cmd: