Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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}
if parallel:
util.validate_parallel_cmd_args(command_args)
base.execute_cmdline_scenarios(scenario_name, args, command_args)
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)
def create(ctx, scenario_name, driver_name): # pragma: no cover
""" Use the provisioner to start the instances. """
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'subcommand': subcommand, 'driver_name': driver_name}
base.execute_cmdline_scenarios(scenario_name, args, command_args)
def prepare(ctx, scenario_name, driver_name, force): # pragma: no cover
"""
Use the provisioner to prepare the instances into a particular starting
state.
"""
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {
'subcommand': subcommand,
'driver_name': driver_name,
'force': force,
}
base.execute_cmdline_scenarios(scenario_name, args, command_args)
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)
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)
def lint(ctx, scenario_name): # pragma: no cover
""" Lint the role (dependency, lint). """
args = ctx.obj.get('args')
subcommand = base._get_subcommand(__name__)
command_args = {'subcommand': subcommand}
base.execute_cmdline_scenarios(scenario_name, args, command_args)