[cwctl] add a no-config-update option to the upgrade command (closes #17069607) 3.25
authorDavid Douard <david.douard@logilab.fr>
Mon, 03 Apr 2017 14:43:44 +0200
branch3.25
changeset 12139 b5be819872bb
parent 12138 10a18c6c5e10
child 12140 20035170160c
[cwctl] add a no-config-update option to the upgrade command (closes #17069607)
cubicweb/cwctl.py
--- a/cubicweb/cwctl.py	Fri Apr 07 14:31:41 2017 +0200
+++ b/cubicweb/cwctl.py	Mon Apr 03 14:43:44 2017 +0200
@@ -690,6 +690,11 @@
           'default': False,
           'help': 'only upgrade files on the file system, not the database.'}),
 
+        ('no-config-update',
+         {'short': 'C', 'action': 'store_true',
+          'default': False,
+          'help': 'do NOT update config file if set.'}),
+
         ('nostartstop',
          {'short': 'n', 'action' : 'store_true',
           'default': False,
@@ -768,7 +773,8 @@
         else:
             print('-> no data migration needed for instance %s.' % appid)
         # rewrite main configuration file
-        mih.rewrite_configuration()
+        if not self.config.no_config_update:
+            mih.rewrite_configuration()
         mih.shutdown()
         # handle i18n upgrade
         if not self.i18nupgrade(config):