bin/cubicweb-ctl
author Laurent Peuch <cortex@worlddomination.be>
Mon, 22 Jul 2019 11:21:10 +0200
changeset 12696 eb83daa69495
parent 12253 9165f4b7426b
child 12779 44147dab9d27
permissions -rwxr-xr-x
[cubicweb-ctl] respect sys.exit status code when aborting a command When exploring the stack of all calls to a cubicweb-ctl command, it has been discovered than on a KeyboardInterrupt and on a SystemExit exception the base class InstanceCommand (for commands that works on one instance) will always set the return code of cubicweb-ctl to 8: this mean that if another command do a `sys.exit(some_code)` the exit code will be ignored and overwritten by '8'. This behavior is not intuitive, apparently not documented and doesn't seems to have any justification. It also prevent commands from exciting with different return codes which could be a desired behavior in the situation of scripting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
#!/usr/bin/env python
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
from cubicweb.cwctl import run
12253
9165f4b7426b Set a default value for arguments of cubicweb.cwctl:run()
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 0
diff changeset
     3
run()