[upgrade] after upgrade, fork command to start instance avoid grave uicfg pb (explicit rules all removed...) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 31 Mar 2010 09:45:14 +0200
branchstable
changeset 5092 e126becc1263
parent 5091 ae161c25a68e
child 5093 8d073d2e089d
[upgrade] after upgrade, fork command to start instance avoid grave uicfg pb (explicit rules all removed...)
cwctl.py
--- a/cwctl.py	Tue Mar 30 19:59:56 2010 +0200
+++ b/cwctl.py	Wed Mar 31 09:45:14 2010 +0200
@@ -796,7 +796,7 @@
         # handle i18n upgrade:
         # * install new languages
         # * recompile catalogs
-        # in the first componant given
+        # XXX search available language in the first cube given
         from cubicweb import i18n
         templdir = cwcfg.cube_dir(config.cubes()[0])
         langs = [lang for lang, _ in i18n.available_catalogs(join(templdir, 'i18n'))]
@@ -811,7 +811,12 @@
         print
         print '-> instance migrated.'
         if not (CWDEV or self.config.nostartstop):
-            StartInstanceCommand().start_instance(appid)
+            # restart instance through fork to get a proper environment, avoid
+            # uicfg pb (and probably gettext catalogs, to check...)
+            forkcmd = '%s start %s' % (sys.argv[0], appid)
+            status = system(forkcmd)
+            if status:
+                print '%s exited with status %s' % (forkcmd, status)
         print