From 9f42a4085399a080f72b9ef60135fe53ec7af70d Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Fri, 8 Nov 2013 15:02:57 +0800 Subject: [PATCH] Create now prevents usage of --engine with --install. Fixes #67 --- lib/commands/create.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/commands/create.py b/lib/commands/create.py index 41ac79a..7e41345 100644 --- a/lib/commands/create.py +++ b/lib/commands/create.py @@ -39,24 +39,24 @@ class CreateCommand(Command): super(CreateCommand, self).__init__(*args, **kwargs) self._arguments = [ ( + ['-i', '--install'], + { + 'action': 'store_true', + 'dest': 'install', + 'help': 'launch the installation script after creating the instance' + } + ), + ( ['-e', '--engine'], { 'action': 'store', 'choices': ['mysqli', 'pgsql'], 'default': self.C.get('defaultEngine'), - 'help': 'database engine to use', + 'help': 'database engine to install the instance on, use with --install', 'metavar': 'engine' } ), ( - ['-i', '--install'], - { - 'action': 'store_true', - 'dest': 'install', - 'help': 'launch the installation script after creating the instance' - } - ), - ( ['-t', '--integration'], { 'action': 'store_true', @@ -109,6 +109,10 @@ class CreateCommand(Command): engine = args.engine versions = args.version suffixes = args.suffix + install = args.install + + if engine and not install: + self.argumentError('--engine can only be used with --install.') for version in versions: for suffix in suffixes: @@ -118,7 +122,7 @@ class CreateCommand(Command): 'engine': engine, 'integration': args.integration, 'identifier': args.identifier, - 'install': args.install, + 'install': install, 'run': args.run } self.do(arguments) -- 2.11.0