コード例 #1
0
def openstack_molecule_instance(temp_dir, temp_files, state_path_without_data):
    c = temp_files(fixtures=['molecule_openstack_v1_config'])
    m = core.Molecule(config.ConfigV1(configs=c), {})
    m.state = state.State(state_file=state_path_without_data)
    m.main()

    return m
コード例 #2
0
def molecule_instance(temp_dir, temp_files, state_path_without_data):
    c = temp_files(fixtures=['molecule_docker_config'])
    m = core.Molecule({})
    m.config = config.Config(configs=c)
    m.state = state.State(state_file=state_path_without_data)

    return m
コード例 #3
0
def molecule_instance(temp_files, molecule_args):
    c = temp_files(fixtures=['molecule_vagrant_config'])
    m = core.Molecule(molecule_args)
    m.config = config.Config(configs=c)
    m.main()

    return m
コード例 #4
0
def molecule_instance(temp_files, state_path_without_data):
    c = temp_files(fixtures=['molecule_vagrant_config'])
    m = core.Molecule(dict())
    m.config = config.Config(configs=c)
    m.state = state.State(state_file=state_path_without_data)

    return m
コード例 #5
0
def molecule_instance(temp_files, state_path):
    c = temp_files(fixtures=['molecule_openstack_config'])
    m = core.Molecule(dict())
    m.config = config.Config(configs=c)
    m._state = state.State(state_file=state_path)

    return m
コード例 #6
0
ファイル: conftest.py プロジェクト: omadahealth/molecule
def molecule_default_provider_instance(temp_files, state_path_without_data,
                                       molecule_args):
    c = temp_files(fixtures=['molecule_vagrant_config'])
    m = core.Molecule(molecule_args)
    m.config = config.Config(configs=c)
    m.state = state.State(state_file=state_path_without_data)
    m.main()

    return m
コード例 #7
0
def molecule_instance_with_env_expansion(temp_dir, temp_files,
                                         state_path_without_data):
    os.environ['MOLECULE_TEST_01'] = 'vagrant'
    os.environ['MOLECULE_TEST_02'] = 'ubuntu'
    os.environ['MOLECULE_TEST_03'] = 'trusty64'
    os.environ['MOLECULE_TEST_04'] = 'example1'
    os.environ['MOLECULE_TEST_05'] = 'append_platform_to_hostname'
    c = temp_files(fixtures=['molecule_vagrant_v1_config_using_env'])
    m = core.Molecule(config.ConfigV1(configs=c), {})
    m.state = state.State(state_file=state_path_without_data)
    m.main()

    return m
コード例 #8
0
    def __init__(self, command_args, args, molecule=False):
        """
        Initialize commands

        :param command_args: arguments of the command
        :param args: arguments from the CLI
        :param molecule: molecule instance
        """
        self.args = docopt.docopt(self.__doc__, argv=command_args)
        self.args['<command>'] = self.__class__.__name__.lower()
        self.command_args = command_args

        # allow us to reuse an existing molecule instance
        if not molecule:
            self.molecule = core.Molecule(self.args)
            self.main()
        else:
            self.molecule = molecule
コード例 #9
0
    def __init__(self, command_args, args, molecule=False):
        """
        Base initializer for all :ref:`Command` classes.

        :param command_args: A list of aruments passed to the subcommand from
         the CLI.
        :param args: A dict of options, arguments and commands from the CLI.
        :param molecule: An optional instance of molecule.
        :returns: None
        """
        self.args = docopt.docopt(self.__doc__, argv=command_args)
        self.args['<command>'] = self.__class__.__name__.lower()
        self.command_args = command_args

        if not molecule:
            self.molecule = core.Molecule(self.args)
            self.main()
        else:
            self.molecule = molecule
コード例 #10
0
ファイル: base.py プロジェクト: robtec/molecule
    def __init__(self, args, command_args, molecule=None):
        """
        Base initializer for all :ref:`Command` classes.

        :param args: A dict of options, arguments and commands from the CLI.
        :param command_args: A dict of options passed to the subcommand from
         the CLI.
        :param molecule: An optional instance of molecule.
        :returns: None
        """
        self.args = args
        self.command_args = command_args

        options = args.copy()
        options.update(command_args)

        if not molecule:
            self.molecule = core.Molecule(options)
            self.main()
        else:
            self.molecule = molecule
コード例 #11
0
ファイル: base.py プロジェクト: vermuz/molecule
 def _get_core(self, options):
     return core.Molecule(self._config, options)
コード例 #12
0
def molecule_instance(temp_files):
    c = temp_files(fixtures=['molecule_docker_config'])
    m = core.Molecule(dict())
    m.config = config.Config(configs=c)

    return m