[cubicweb-ctl] i18ncube return 2 (failed command) on failure (closes #2192336) stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 15 Feb 2012 18:12:38 +0100
branchstable
changeset 8247 65b0d2587fb5
parent 8245 d53762ae5961
child 8248 9550555e4c26
[cubicweb-ctl] i18ncube return 2 (failed command) on failure (closes #2192336) i18ncube command previously returned 0 even on failure. Bisect i18n breakage was hard.
devtools/devctl.py
--- a/devtools/devctl.py	Mon Feb 20 11:32:06 2012 +0100
+++ b/devtools/devctl.py	Wed Feb 15 18:12:38 2012 +0100
@@ -32,7 +32,7 @@
 from logilab.common import STD_BLACKLIST
 
 from cubicweb.__pkginfo__ import version as cubicwebversion
-from cubicweb import CW_SOFTWARE_ROOT as BASEDIR, BadCommandUsage
+from cubicweb import CW_SOFTWARE_ROOT as BASEDIR, BadCommandUsage, ExecutionError
 from cubicweb.cwctl import CWCTL
 from cubicweb.cwconfig import CubicWebNoAppConfiguration
 from cubicweb.toolsutils import (SKEL_EXCLUDE, Command, copy_skeleton,
@@ -377,7 +377,8 @@
                      for cube in DevConfiguration.available_cubes()]
             cubes = [cubepath for cubepath in cubes
                      if osp.exists(osp.join(cubepath, 'i18n'))]
-        update_cubes_catalogs(cubes)
+        if not update_cubes_catalogs(cubes):
+            raise ExecutionError("update cubes i18n catalog failed")
 
 
 def update_cubes_catalogs(cubes):
@@ -391,6 +392,7 @@
             import traceback
             traceback.print_exc()
             print '-> error while updating catalogs for cube', cubedir
+            return False
         else:
             # instructions pour la suite
             if toedit:
@@ -399,6 +401,7 @@
                 print '* ' + '\n* '.join(toedit)
                 print ('When you are done, run "cubicweb-ctl i18ninstance '
                        '<yourinstance>" to see changes in your instances.')
+            return True
 
 def update_cube_catalogs(cubedir):
     import shutil