#NEWLINE# def import_image( src , repo , tag = None ) : #NEWLINE# #INDENT# "\n    Import content from a local tarball or a URL to a docker image\n\n    src\n        content to import (URL or absolute path to a tarball)\n\n    repo\n        repository to import to\n\n    tag\n        set tag of the image (Optional)\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' docker.import_image <src> <repo> [tag]\n    " #NEWLINE# client = _get_client ( ) #NEWLINE# status = base_status . copy ( ) #NEWLINE# try : #NEWLINE# #INDENT# ret = client . import_image ( src , repository = repo , tag = tag ) #NEWLINE# if ret : #NEWLINE# #INDENT# ( image_logs , _info ) = _parse_image_multilogs_string ( ret ) #NEWLINE# _create_image_assemble_error_status ( status , ret , image_logs ) #NEWLINE# if ( status [ 'status' ] is not False ) : #NEWLINE# #INDENT# infos = _get_image_infos ( image_logs [ 0 ] [ 'status' ] ) #NEWLINE# _valid ( status , comment = 'Image {0} was created' . format ( infos [ 'Id' ] ) , id_ = infos [ 'Id' ] , out = repo ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# _invalid ( status ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# _invalid ( status , out = traceback . format_exc ( ) ) #NEWLINE# #UNINDENT# return status