def single_cmd(container, command, fail_nonzero=False, download_result=None, **kwargs):
    """
    Runs a script inside a container, which is created with all its dependencies. The container is removed after it
    has been run, whereas the dependencies are not destroyed. The output is printed to the console.

    :param container: Container configuration name.
    :param command: Command line to run.
    :param fail_nonzero: Fail if the script returns with a nonzero exit code.
    :param download_result: Download any results that the command has written back to a temporary directory.
    :param kwargs: Additional keyword arguments to the run_script action.
    """
    with temp_dir() as remote_tmp:
        kwargs.setdefault('command_format', ['-c', command])
        results = [output.result
                   for output in container_fabric().run_script(container, script_path=remote_tmp, **kwargs)
                   if o.action_type == ContainerUtilAction.SCRIPT]
        if download_result:
            get(posixpath.join(remote_tmp, '*'), local_path=download_result)
    for res in results:
        puts("Exit code: {0}".format(res['exit_code']))
        if res['exit_code'] == 0 or not fail_nonzero:
            puts(res['log'])
        else:
            error(res['log'])
def single_cmd ( container , command , fail_nonzero = False , download_result = None , ** kwargs ) : with temp_dir ( ) as remote_tmp : kwargs . setdefault ( 'command_format' , [ '-c' , command ] ) results = [ output . result for output in container_fabric ( ) . run_script ( container , script_path = remote_tmp , ** kwargs ) if o . action_type == ContainerUtilAction . SCRIPT ] if download_result : get ( posixpath . join ( remote_tmp , '*' ) , local_path = download_result ) for res in results : puts ( "Exit code: {0}" . format ( res [ 'exit_code' ] ) ) if res [ 'exit_code' ] == 0 or not fail_nonzero : puts ( res [ 'log' ] ) else : error ( res [ 'log' ] )
Runs a script inside a container, which is created with all its dependencies. The container is removed after it
    has been run, whereas the dependencies are not destroyed. The output is printed to the console.

    :param container: Container configuration name.
    :param command: Command line to run.
    :param fail_nonzero: Fail if the script returns with a nonzero exit code.
    :param download_result: Download any results that the command has written back to a temporary directory.
    :param kwargs: Additional keyword arguments to the run_script action.