403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/chocolatey.cpython-310.pyc
o

;j!A�@s|dZddlZddlZddlmZdd�Z											ddd�Zdd	d
�Z								ddd�Z		dd
d�Z
dS)a@
Manage Windows Packages using Chocolatey
.. versionadded:: 2016.3.0

.. note::
    Chocolatey pulls data from the Chocolatey internet database to determine
    current versions, find available versions, etc. This is normally a slow
    operation and may be optimized by specifying a local, smaller chocolatey
    repo.
�N)�SaltInvocationErrorcCsdtvrdSdS)z+
    Load only if chocolatey is loaded
    �chocolatey.installZ
chocolatey)Fz%chocolatey module could not be loaded)�__salt__�rr�J/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/chocolatey.py�__virtual__srFcCs�|r|	rtd��|didd�}tddd�}
|��dd�|
��D�vr9|r0|�d	|�d
�|d<n�d|�d
�|d<n{|}|
��D]}|��|��krK|}q?|
|}|r�tjjj|d
|d�rt|ri|�d	|�d�|d<nK|�d	|�d�|d<n@|	r�|�d	|�d|�d	|�d�|d<n-|�d	|�d|�d	|��|d<d}n|}|r�|�d	|�d�|d<n|�d	|�d�|d<|Stdr�d|d<|Std||||||||||	|
|d�}d|vr�|�d�|d<d|d<nd|��|d<d|d<tddd�}tjj	�
|
|�|d<|S)ap	
    Installs a package if not already installed

    Args:

        name (str):
            The name of the package to be installed. Required.

        version (str):
            Install a specific version of the package. Defaults to the latest
            version. If the version is different to the one installed, then the
            specified version will be installed. Default is ``None``.

        source (str):
            Chocolatey repository (directory, share or remote URL, feed).
            ``None`` defaults to the official Chocolatey feed. Default is
            ``None``.

        force (bool):
            Reinstall the current version of an existing package. Do not use
            with ``allow_multiple``. Default is ``False``.

        pre_versions (bool):
            Include pre-release packages. Default is ``False``.

        install_args (str):
            Install arguments you want to pass to the installation process, i.e.
            product key or feature list. Default is ``None``.

        override_args (bool):
            Set to ``True`` to override the original install arguments (for the
            native installer) in the package and use your own. When this is set
            to ``False``, install_args will be appended to the end of the
            default arguments. Default is ``False``.

        force_x86 (bool):
            Force x86 (32bit) installation on 64bit systems. Default is
            ``False``.

        package_args (str):
            Arguments you want to pass to the package. Default is ``None``.

        allow_multiple (bool):
            Allow multiple versions of the package to be installed. Do not use
            with ``force``. Does not work with all packages. Default is
            ``False``.

            .. versionadded:: 2017.7.0

        execution_timeout (str):
            Chocolatey execution timeout value you want to pass to the
            installation process. Default is ``None``.

        virus_check (bool):
            Enable or disable the chocolatey virus check extension (licensed
            version only). If not provided then no arguments are added.
            Default is ``None``.

    Example:

    .. code-block:: yaml

        install_some_package:
          chocolatey.installed:
            - name: packagename
            - version: '12.04'
            - source: 'mychocolatey/source'
            - force: True
    z7Cannot use 'force' in conjunction with 'allow_multiple'T���name�result�changes�comment�chocolatey.list�Z
local_onlycS�g|]}|���qSr��lower��.0�packagerrr�
<listcomp>y�zinstalled.<locals>.<listcomp>� � will be installedr
�Latest version of �==�Zver1ZoperZver2� will be reinstalled� is already installedz% will be installed side by side with z
 if supportedz will be installed over �testNrr)r
�version�source�force�pre_versions�install_args�
override_args�	force_x86�package_args�allow_multiple�execution_timeout�virus_check�Running chocolatey failedz installed successfullyzFailed to install Fr)rrr�keys�salt�utils�versions�compare�__opts__�data�
compare_dicts)r
r r!r"r#r$r%r&r'r(r)r*�ret�pre_install�	full_name�pkg�installed_versionr�post_installrrr�	installedsvS������
r:cCs|didd�}tddd�}|��dd�|��D�vr<z|�d||d	�d
�|d<Wnty;|�d
�|d<Ynwd|�d
�|d<|StdrPd|d<|Std||||�}d|vri|�d�|d<d|d<nd|��|d<d|d<tddd�}tjj�||�|d<|S)a�
    Uninstalls a chocolatey package

    Args:

        name (str):
            The name of the package to be uninstalled. Required.

        version (str):
            Uninstalls a specific version of the package. Defaults to the latest
            version installed.

        uninstall_args (str):
            A list of uninstall arguments you want to pass to the uninstallation
            process, i.e. product key or feature list

        override_args (str):
            Set to ``True`` if you want to override the original uninstall
            arguments (for the native uninstaller) in the package and use your
            own. When this is set to ``False``, uninstall_args will be appended
            to the end of the default arguments

    Example:

    .. code-block:: yaml

      remove_my_package:
        chocolatey.uninstalled:
          - name: mypackage
          - version: '21.5'
    Trr	rrcSrrrrrrrr�rzuninstalled.<locals>.<listcomp>rrz will be removedr
zThe package z is not installedrNrzchocolatey.uninstallr+z uninstalled successfullyzFailed to uninstall Fr)	rrr,�KeyErrorr1r-r.r2r3)r
r Zuninstall_argsr%r4Z
pre_uninstallrZpost_uninstallrrr�uninstalled�s0! ��
r<c	Cs�|didd�}	tddd�}
|��dd�|
��D�vr1|r(|�d|�d	�|	d
<n�d|�d	�|	d
<n�td|d|d
�}|}|D]}
|��|
��krJ|
}q>||dd}|scd||vrc||dd}|r�tjjj|d|d�r�|r||�d|�d�|	d
<n5|�d|�d�|	d
<|	Stjjj|d|d�r�|�d|�d|��|	d
<n|�d|�d�|	d
<|	Sd|	d
<|	Stdr�d|	d<|	Std|||||||||d�	}d|vr�|�d�|	d
<d|	d<nd |��|	d
<d!|	d<tddd�}tjj�	|
|�|	d"<|	S)#a
    Upgrades a chocolatey package. Will install the package if not installed.

    .. versionadded:: 2018.3.0

    Args:

        name (str):
            The name of the package to be installed. Required.

        version (str):
            Install a specific version of the package. Defaults to latest
            version. If the version is greater than the one installed then the
            specified version will be installed. Default is ``None``.

        source (str):
            Chocolatey repository (directory, share or remote URL, feed).
            Defaults to the official Chocolatey feed. Default is ``None``.

        force (bool):
            ``True`` will reinstall an existing package with the same version.
            Default is ``False``.

        pre_versions (bool):
            ``True`` will include pre-release packages. Default is ``False``.

        install_args (str):
            Install arguments you want to pass to the installation process, i.e
            product key or feature list. Default is ``None``.

        override_args (bool):
            ``True`` will override the original install arguments (for the
            native installer) in the package and use those specified in
            ``install_args``. ``False`` will append install_args to the end of
            the default arguments. Default is ``False``.

        force_x86 (bool):
            ``True`` forces 32bit installation on 64bit systems. Default is
            ``False``.

        package_args (str):
            Arguments you want to pass to the package. Default is ``None``.

    Example:

    .. code-block:: yaml

        upgrade_some_package:
          chocolatey.upgraded:
            - name: packagename
            - version: '12.04'
            - source: 'mychocolatey/source'
    Trr	rrcSrrrrrrrrTrzupgraded.<locals>.<listcomp>rrr
rzchocolatey.version)r
Zcheck_remoter!r:rZ	availablerrrr�<z will be upgraded to version z (newer) is already installedzNo version found to installrNrzchocolatey.upgrade)	r
r r!r"r#r$r%r&r'r+z upgraded successfullyzFailed to upgrade Fr)
rrr,r-r.r/r0r1r2r3)r
r r!r"r#r$r%r&r'r4r5�version_infor6r7r8rr9rrr�upgraded
st@�������
r?c
Cs�|didd�}td�}|��dd�|��D�vr!|�d�|d<n|r+|�d	�|d<n	|�d
�|d<|Stdr>d|d
<|Std|||||d�}d|vrZd|d
<d|�d�|d<nd|d
<d|��|d<td�}	tjj�||	�|d<|S)a�
    Adds a Chocolatey source if not already present.

    Args:

        name (str):
            The name of the source to be added as a chocolatey repository.

        source (str):
            Location of the source you want to work with.

        username (str):
            The username for a chocolatey source that needs authentication
            credentials.

        password (str):
            The password for a chocolatey source that needx authentication
            credentials.

        force (bool):
            Salt will not modify an existing repository with the same name. Set
            this option to ``True`` to update an existing repository.

        priority (int):
            The priority order of this source as compared to other sources.
            Lower is better. Defaults to 0 (no priority). All priorities
            above 0 will be evaluated first, then zero-based values will be
            evaluated in config file order.

    Example:

    .. code-block:: yaml

        add_some_source:
          chocolatey.source_present:
            - name: reponame
            - source: https://repo.exemple.com
            - username: myuser
            - password: mypassword
            - priority: 100
    Trr	zchocolatey.list_sourcescSrrr)rZpresentrrrr�rz"source_present.<locals>.<listcomp>z will be addedr
z will be updatedz is already presentrNrzchocolatey.add_source)r
�source_location�username�password�priorityr+zSource z added successfullyFzFailed to add the source r)rrr,r1r-r.r2r3)
r
r@rArBr"rCr4r5rr9rrr�source_present�s4,
�
rD)NNFFNFFNFNN)NNF)NNFFNFFN)NNFN)�__doc__Zsalt.utils.datar-Zsalt.utils.versionsZsalt.exceptionsrrr:r<r?rDrrrr�<module>s>
�
,J
�$�

Youez - 2016 - github.com/yon3zu
LinuXploit