#NEWLINE# def install_python( name , version = None , install_args = None , override_args = False ) : #NEWLINE# #INDENT# "\n    Instructs Chocolatey to install a package via Python's easy_install.\n\n    name\n        The name of the package to be installed. Only accepts a single argument.\n\n    version\n        Install a specific version of the package. Defaults to latest version\n        available.\n\n    install_args\n        A list of install arguments you want to pass to the installation process\n        i.e product key or feature list\n\n    override_args\n        Set to true if you want to override the original install arguments (for the native installer)\n         in the package and use your own. When this is set to False install_args will be appended to the end of the\n         default arguments\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' chocolatey.install_python <package name>\n        salt '*' chocolatey.install_python <package name> version=<package version>\n        salt '*' chocolatey.install_python <package name> install_args=<args> override_args=True\n    " #NEWLINE# choc_path = _find_chocolatey ( __context__ , __salt__ ) #NEWLINE# cmd = [ choc_path , 'python' , name ] #NEWLINE# if version : #NEWLINE# #INDENT# cmd . extend ( [ '-Version' , version ] ) #NEWLINE# #UNINDENT# if install_args : #NEWLINE# #INDENT# cmd . extend ( [ '-InstallArguments' , install_args ] ) #NEWLINE# #UNINDENT# if override_args : #NEWLINE# #INDENT# cmd . extend ( [ '-OverrideArguments' ] ) #NEWLINE# #UNINDENT# cmd . extend ( _yes ( __context__ ) ) #NEWLINE# result = __salt__ [ 'cmd.run_all' ] ( cmd , python_shell = False ) #NEWLINE# if ( result [ 'retcode' ] != 0 ) : #NEWLINE# #INDENT# err = 'Running chocolatey failed: {0}' . format ( result [ 'stderr' ] ) #NEWLINE# log . error ( err ) #NEWLINE# raise CommandExecutionError ( err ) #NEWLINE# #UNINDENT# return result [ 'stdout' ]