Exemplo n.º 1
0
def exec_single(command, variables={ }, plugins=[]):
    """
    Method will create executor object and execute it is desired
    :param command:
    :return:
    """
    ex = Executor(command.format(**variables), [PluginEnv(variables)] if not plugins else plugins)
    ex.run()
    return ex
Exemplo n.º 2
0
def exec_all(command, variables={ }, plugin_generator=[]):
    """
    Method which will return list of executors for every combination of variables
    :param command:
    :param variables:
    :param plugin_generator:
    :return:
    """
    commands, plugins = expand_command(
        command,
        expand_vars(variables) if type(variables) is list else variables,
        plugin_generator)

    result = []
    for i in range(len(commands)):
        ex = Executor(commands[i], plugins[i])
        result.append(ex.run())
    return result