Commit 97649a5c authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

[cubicweb-ctl] i18ncube return 2 (failed command) on failure (closes #2192336)

i18ncube command previously returned 0 even on failure. Bisect i18n breakage was
hard.

--HG--
branch : stable
parent d53762ae5961
......@@ -32,7 +32,7 @@ from warnings import warn
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 @@ class UpdateCubeCatalogCommand(Command):
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 @@ def update_cubes_catalogs(cubes):
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 @@ def update_cubes_catalogs(cubes):
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment