[c-c create] make post-create step optional (closes #2712041)
authorDavid Douard <david.douard@logilab.fr>
Wed, 03 Apr 2013 12:17:24 +0200
changeset 8851 0020aa12af07
parent 8850 4032499c701e
child 8852 59a29405688c
[c-c create] make post-create step optional (closes #2712041) In this context the "post-create" step refers to the database's creation and initialization. We want to be able to create a new instance but skip the database creation (`db-create` and `db-init` commands) in automatic setup.
cwctl.py
--- a/cwctl.py	Fri Mar 15 12:11:29 2013 +0100
+++ b/cwctl.py	Wed Apr 03 12:17:24 2013 +0200
@@ -365,6 +365,12 @@
           ' "list" command. Default to "all-in-one", e.g. an installation '
           'embedding both the RQL repository and the web server.',
           }),
+        ('no-post-create',
+         {'short': 'P',
+          'action': 'store_true',
+          'default': False,
+          'help': 'do not run post-create tasks (database creation, etc.)',
+          }),
         )
 
     def run(self, args):
@@ -433,7 +439,8 @@
             print 'set %s as owner of the data directory' % config['uid']
             chown(config.appdatahome, config['uid'])
         print '\n-> creation done for %s\n' % repr(config.apphome)[1:-1]
-        helper.postcreate(self.config.automatic)
+        if not self.config.no_post_create:
+            helper.postcreate(self.config.automatic)
 
     def _handle_win32(self, config, appid):
         if sys.platform != 'win32':