Skip to content

Commit

Permalink
Renamed check to syntax-check
Browse files Browse the repository at this point in the history
This is in preparation for implementing dry-run ansible#128.
  • Loading branch information
retr0h committed Jul 9, 2016
1 parent 23c97a6 commit dacedc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions molecule/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
molecule [-hv] <command> [<args>...]
Commands:
check check playbook syntax
check-syntax check playbook syntax
create create instances
converge create and provision instances
idempotence converge and check the output for changes
Expand Down Expand Up @@ -53,11 +53,13 @@ def main(self):
args = docopt(__doc__,
version=molecule.__version__,
options_first=True)
command_name = args.get('<command>').capitalize()
subcommand = args.get('<command>')
constantize = ''.join(str.capitalize()
for str in subcommand.split('-'))
command_args = {} if args.get('<args>') is None else args.pop('<args>')

try:
command_class = getattr(molecule.commands, command_name)
command_class = getattr(molecule.commands, constantize)
except AttributeError:
raise DocoptExit()

Expand Down
4 changes: 2 additions & 2 deletions molecule/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ def execute(self):
raise NotImplementedError


class Check(AbstractCommand):
class CheckSyntax(AbstractCommand):
"""
Performs a syntax check on the current role.
Usage:
check
check-syntax
"""

def execute(self, exit=True):
Expand Down
2 changes: 1 addition & 1 deletion molecule/conf/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ molecule:
# sequence of commands to run when performing `molecule test`
sequence:
- destroy
- check
- check-syntax
- create
- converge
- idempotence
Expand Down

0 comments on commit dacedc7

Please sign in to comment.