Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update format for yapf 0.27 #1911

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions molecule/command/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def execute_cmdline_scenarios(scenario_name, args, command_args):
:returns: None

"""
scenarios = molecule.scenarios.Scenarios(
get_configs(args, command_args), scenario_name)
scenarios = molecule.scenarios.Scenarios(get_configs(args, command_args),
scenario_name)
scenarios.print_matrix()
for scenario in scenarios:
try:
Expand Down
11 changes: 5 additions & 6 deletions molecule/command/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ def execute(self):

@click.command()
@click.pass_context
@click.option(
'--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option('--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
def check(ctx, scenario_name): # pragma: no cover
"""
Use the provisioner to perform a Dry-Run (destroy, dependency, create,
Expand Down
11 changes: 5 additions & 6 deletions molecule/command/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ def execute(self):

@click.command(name='cleanup')
@click.pass_context
@click.option(
'--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option('--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
def cleanup(ctx, scenario_name): # pragma: no cover
"""
Use the provisioner to cleanup any changes made to external systems during
Expand Down
11 changes: 5 additions & 6 deletions molecule/command/converge.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ def execute(self):

@click.command()
@click.pass_context
@click.option(
'--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option('--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.argument('ansible_args', nargs=-1, type=click.UNPROCESSED)
def converge(ctx, scenario_name, ansible_args): # pragma: no cover
"""
Expand Down
20 changes: 9 additions & 11 deletions molecule/command/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,15 @@ def execute(self):

@click.command()
@click.pass_context
@click.option(
'--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option(
'--driver-name',
'-d',
type=click.Choice(config.molecule_drivers()),
help='Name of driver to use. (docker)')
@click.option('--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option('--driver-name',
'-d',
type=click.Choice(config.molecule_drivers()),
help='Name of driver to use. (docker)')
def create(ctx, scenario_name, driver_name): # pragma: no cover
""" Use the provisioner to start the instances. """
args = ctx.obj.get('args')
Expand Down
11 changes: 5 additions & 6 deletions molecule/command/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ def execute(self):

@click.command()
@click.pass_context
@click.option(
'--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option('--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
def dependency(ctx, scenario_name): # pragma: no cover
""" Manage the role's dependencies. """
args = ctx.obj.get('args')
Expand Down
29 changes: 13 additions & 16 deletions molecule/command/destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,19 @@ def execute(self):

@click.command()
@click.pass_context
@click.option(
'--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option(
'--driver-name',
'-d',
type=click.Choice(config.molecule_drivers()),
help='Name of driver to use. (docker)')
@click.option(
'--all/--no-all',
'__all',
default=False,
help='Destroy all scenarios. Default is False.')
@click.option('--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option('--driver-name',
'-d',
type=click.Choice(config.molecule_drivers()),
help='Name of driver to use. (docker)')
@click.option('--all/--no-all',
'__all',
default=False,
help='Destroy all scenarios. Default is False.')
def destroy(ctx, scenario_name, driver_name, __all): # pragma: no cover
""" Use the provisioner to destroy the instances. """
args = ctx.obj.get('args')
Expand Down
11 changes: 5 additions & 6 deletions molecule/command/idempotence.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,11 @@ def _non_idempotent_tasks(self, output):

@click.command()
@click.pass_context
@click.option(
'--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option('--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
def idempotence(ctx, scenario_name): # pragma: no cover
"""
Use the provisioner to configure the instances and parse the output to
Expand Down
6 changes: 3 additions & 3 deletions molecule/command/init/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def _process_templates(self,

def _resolve_template_dir(self, template_dir):
if not os.path.isabs(template_dir):
template_dir = os.path.join(
os.path.dirname(__file__), os.path.pardir, os.path.pardir,
'cookiecutter', template_dir)
template_dir = os.path.join(os.path.dirname(__file__),
os.path.pardir, os.path.pardir,
'cookiecutter', template_dir)

return template_dir
53 changes: 25 additions & 28 deletions molecule/command/init/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,34 +79,31 @@ def execute(self):

@click.command()
@click.pass_context
@click.option(
'--dependency-name',
type=click.Choice(['galaxy']),
default='galaxy',
help='Name of dependency to initialize. (galaxy)')
@click.option(
'--driver-name',
'-d',
type=click.Choice(config.molecule_drivers()),
default='docker',
help='Name of driver to initialize. (docker)')
@click.option(
'--lint-name',
type=click.Choice(['yamllint']),
default='yamllint',
help='Name of lint to initialize. (yamllint)')
@click.option(
'--provisioner-name',
type=click.Choice(['ansible']),
default='ansible',
help='Name of provisioner to initialize. (ansible)')
@click.option(
'--role-name', '-r', required=True, help='Name of the role to create.')
@click.option(
'--verifier-name',
type=click.Choice(config.molecule_verifiers()),
default='testinfra',
help='Name of verifier to initialize. (testinfra)')
@click.option('--dependency-name',
type=click.Choice(['galaxy']),
default='galaxy',
help='Name of dependency to initialize. (galaxy)')
@click.option('--driver-name',
'-d',
type=click.Choice(config.molecule_drivers()),
default='docker',
help='Name of driver to initialize. (docker)')
@click.option('--lint-name',
type=click.Choice(['yamllint']),
default='yamllint',
help='Name of lint to initialize. (yamllint)')
@click.option('--provisioner-name',
type=click.Choice(['ansible']),
default='ansible',
help='Name of provisioner to initialize. (ansible)')
@click.option('--role-name',
'-r',
required=True,
help='Name of the role to create.')
@click.option('--verifier-name',
type=click.Choice(config.molecule_verifiers()),
default='testinfra',
help='Name of verifier to initialize. (testinfra)')
def role(ctx, dependency_name, driver_name, lint_name, provisioner_name,
role_name, verifier_name): # pragma: no cover
""" Initialize a new role for use with Molecule. """
Expand Down
73 changes: 33 additions & 40 deletions molecule/command/init/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,46 +118,39 @@ def _default_scenario_exists(ctx, param, value): # pragma: no cover

@click.command()
@click.pass_context
@click.option(
'--dependency-name',
type=click.Choice(['galaxy']),
default='galaxy',
help='Name of dependency to initialize. (galaxy)')
@click.option(
'--driver-name',
'-d',
type=click.Choice(config.molecule_drivers()),
default='docker',
help='Name of driver to initialize. (docker)')
@click.option(
'--lint-name',
type=click.Choice(['yamllint']),
default='yamllint',
help='Name of lint to initialize. (ansible-lint)')
@click.option(
'--provisioner-name',
type=click.Choice(['ansible']),
default='ansible',
help='Name of provisioner to initialize. (ansible)')
@click.option(
'--role-name',
'-r',
required=False,
callback=_role_exists,
help='Name of the role to create.')
@click.option(
'--scenario-name',
'-s',
default=command_base.MOLECULE_DEFAULT_SCENARIO_NAME,
required=True,
callback=_default_scenario_exists,
help='Name of the scenario to create. ({})'.format(
command_base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option(
'--verifier-name',
type=click.Choice(config.molecule_verifiers()),
default='testinfra',
help='Name of verifier to initialize. (testinfra)')
@click.option('--dependency-name',
type=click.Choice(['galaxy']),
default='galaxy',
help='Name of dependency to initialize. (galaxy)')
@click.option('--driver-name',
'-d',
type=click.Choice(config.molecule_drivers()),
default='docker',
help='Name of driver to initialize. (docker)')
@click.option('--lint-name',
type=click.Choice(['yamllint']),
default='yamllint',
help='Name of lint to initialize. (ansible-lint)')
@click.option('--provisioner-name',
type=click.Choice(['ansible']),
default='ansible',
help='Name of provisioner to initialize. (ansible)')
@click.option('--role-name',
'-r',
required=False,
callback=_role_exists,
help='Name of the role to create.')
@click.option('--scenario-name',
'-s',
default=command_base.MOLECULE_DEFAULT_SCENARIO_NAME,
required=True,
callback=_default_scenario_exists,
help='Name of the scenario to create. ({})'.format(
command_base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option('--verifier-name',
type=click.Choice(config.molecule_verifiers()),
default='testinfra',
help='Name of verifier to initialize. (testinfra)')
def scenario(ctx, dependency_name, driver_name, lint_name, provisioner_name,
role_name, scenario_name, verifier_name): # pragma: no cover
""" Initialize a new scenario for use with Molecule. """
Expand Down
16 changes: 7 additions & 9 deletions molecule/command/init/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,18 @@ def execute(self):

@click.command()
@click.pass_context
@click.option(
'--url',
required=True,
help='URL to the Cookiecutter templates repository.')
@click.option('--url',
required=True,
help='URL to the Cookiecutter templates repository.')
@click.option(
'--no-input/--input',
default=False,
help=('Do not prompt for parameters and only use cookiecutter.json for '
'content. (false)'))
@click.option(
'--role-name',
'-r',
default='role_name',
help='Name of the role to create.')
@click.option('--role-name',
'-r',
default='role_name',
help='Name of the role to create.')
def template(ctx, url, no_input, role_name): # pragma: no cover
""" Initialize a new role from a Cookiecutter URL. """
command_args = {
Expand Down
11 changes: 5 additions & 6 deletions molecule/command/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ def execute(self):

@click.command()
@click.pass_context
@click.option(
'--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
@click.option('--scenario-name',
'-s',
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME))
def lint(ctx, scenario_name): # pragma: no cover
""" Lint the role. """
args = ctx.obj.get('args')
Expand Down
15 changes: 7 additions & 8 deletions molecule/command/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,11 @@ def execute(self):
@click.command()
@click.pass_context
@click.option('--scenario-name', '-s', help='Name of the scenario to target.')
@click.option(
'--format',
'-f',
type=click.Choice(['simple', 'plain', 'yaml']),
default='simple',
help='Change output format. (simple)')
@click.option('--format',
'-f',
type=click.Choice(['simple', 'plain', 'yaml']),
default='simple',
help='Change output format. (simple)')
def list(ctx, scenario_name, format): # pragma: no cover
""" Lists status of instances. """
args = ctx.obj.get('args')
Expand All @@ -107,8 +106,8 @@ def list(ctx, scenario_name, format): # pragma: no cover
}

statuses = []
s = scenarios.Scenarios(
base.get_configs(args, command_args), scenario_name)
s = scenarios.Scenarios(base.get_configs(args, command_args),
scenario_name)
for scenario in s:
statuses.extend(base.execute_subcommand(scenario.config, subcommand))

Expand Down
Loading