[cwctl] on upgrade, clear instance_md5_version cache
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 22 Oct 2015 16:58:12 +0200
changeset 11878 e42cb31e9301
parent 11877 32a3860c799d
child 11880 bc9d901cb9e6
[cwctl] on upgrade, clear instance_md5_version cache The generate-static-datadir depends on a correct config.instance_md5_version(), and we just invalidated it by upgrading the instance.
cubicweb/cwctl.py
--- a/cubicweb/cwctl.py	Tue Dec 15 08:35:13 2015 +0100
+++ b/cubicweb/cwctl.py	Thu Oct 22 16:58:12 2015 +0200
@@ -41,6 +41,7 @@
 from logilab.common.clcommands import CommandLine
 from logilab.common.shellutils import ASK
 from logilab.common.configuration import merge_options
+from logilab.common.decorators import clear_cache
 
 from cubicweb import ConfigurationError, ExecutionError, BadCommandUsage
 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg, CWDEV, CONFIGURATIONS
@@ -749,6 +750,7 @@
             with mih.cnx:
                 with mih.cnx.security_enabled(False, False):
                     mih.migrate(vcconf, reversed(toupgrade), self.config)
+            clear_cache(config, 'instance_md5_version')
         else:
             print('-> no data migration needed for instance %s.' % appid)
         # rewrite main configuration file