Skip to content

Commit

Permalink
Create now prevents usage of --engine with --install. Fixes #67
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Nov 8, 2013
1 parent cab3479 commit 9f42a40
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@ class CreateCommand(Command):
def __init__(self, *args, **kwargs):
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'],
{
Expand Down Expand Up @@ -109,6 +109,10 @@ def run(self, args):
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:
Expand All @@ -118,7 +122,7 @@ def run(self, args):
'engine': engine,
'integration': args.integration,
'identifier': args.identifier,
'install': args.install,
'install': install,
'run': args.run
}
self.do(arguments)
Expand Down

0 comments on commit 9f42a40

Please sign in to comment.