Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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([str(s) for s in drivers()]),
help='Name of driver to use. (docker)',
)
@click.option(
'--all/--no-all',
'__all',
default=MOLECULE_PARALLEL,
help='Destroy all scenarios. Default is False.',
)
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME
),
)
def login(ctx, host, scenario_name): # pragma: no cover
""" Log in to one instance. """
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'subcommand': subcommand, 'host': host}
s = scenarios.Scenarios(base.get_configs(args, command_args), scenario_name)
for scenario in s.all:
base.execute_subcommand(scenario.config, subcommand)
command_base.MOLECULE_DEFAULT_SCENARIO_NAME
),
)
@click.option(
'--verifier-name',
type=click.Choice([str(s) for s in api.verifiers()]),
default='testinfra',
help='Name of verifier to initialize. (testinfra)',
)
@click.option(
'--driver-template',
type=click.Path(exists=True, dir_okay=True, readable=True, resolve_path=True),
help="Path to a cookiecutter custom driver template to initialize the "
"scenario. If the driver template is not found locally, default "
"template will be used instead.",
)
def scenario(
base.MOLECULE_DEFAULT_SCENARIO_NAME
),
)
def side_effect(ctx, scenario_name): # pragma: no cover
""" Use the provisioner to perform side-effects to the instances. """
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'subcommand': subcommand}
base.execute_cmdline_scenarios(scenario_name, args, command_args)
base.MOLECULE_DEFAULT_SCENARIO_NAME
),
)
def verify(ctx, scenario_name): # pragma: no cover
""" Run automated tests against instances. """
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'subcommand': subcommand}
base.execute_cmdline_scenarios(scenario_name, args, command_args)
base.MOLECULE_DEFAULT_SCENARIO_NAME
),
)
def login(ctx, host, scenario_name): # pragma: no cover
""" Log in to one instance. """
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'subcommand': subcommand, 'host': host}
s = scenarios.Scenarios(base.get_configs(args, command_args), scenario_name)
for scenario in s.all:
base.execute_subcommand(scenario.config, subcommand)
base.MOLECULE_DEFAULT_SCENARIO_NAME
),
)
@click.option(
'--parallel/--no-parallel',
default=MOLECULE_PARALLEL,
help='Enable or disable parallel mode. Default is disabled.',
)
def check(ctx, scenario_name, parallel): # pragma: no cover
"""
Use the provisioner to perform a Dry-Run (destroy, dependency, create,
prepare, converge).
"""
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'parallel': parallel, 'subcommand': subcommand}
default=base.MOLECULE_DEFAULT_SCENARIO_NAME,
help='Name of the scenario to target. ({})'.format(
base.MOLECULE_DEFAULT_SCENARIO_NAME
),
)
def syntax(ctx, scenario_name): # pragma: no cover
""" Use the provisioner to syntax check the role. """
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'subcommand': subcommand}
base.execute_cmdline_scenarios(scenario_name, args, command_args)
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
the stages of testing.
"""
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'subcommand': subcommand}
base.execute_cmdline_scenarios(scenario_name, args, command_args)
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
"""
Use the provisioner to configure instances (dependency, create, prepare
converge).
"""
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'subcommand': subcommand}
base.execute_cmdline_scenarios(scenario_name, args, command_args, ansible_args)