How to use the molecule.command.base.MOLECULE_DEFAULT_SCENARIO_NAME function in molecule

To help you get started, we’ve selected a few molecule examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ansible / molecule / molecule / command / destroy.py View on Github external
    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.',
)
github ansible / molecule / molecule / command / login.py View on Github external
    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)
github ansible / molecule / molecule / command / init / scenario.py View on Github external
        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(
github ansible / molecule / molecule / command / side_effect.py View on Github external
        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)
github ansible / molecule / molecule / command / verify.py View on Github external
        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)
github ansible / molecule / molecule / command / login.py View on Github external
        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)
github ansible / molecule / molecule / command / check.py View on Github external
        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}
github ansible / molecule / molecule / command / syntax.py View on Github external
    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)
github ansible / molecule / molecule / command / cleanup.py View on Github external
        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)
github ansible / molecule / molecule / command / converge.py View on Github external
    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)