File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/win_pkg.cpython-310.pyc
Back
o ;j#j � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddlmZ ddl ZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZmZmZmZ ddlmZ e� e!�Z"dZ#dd� Z$d d � Z%dd� Z&d d� Z'dDdd�Z(dd� Z)dd� Z* dEdd�Z+dFdd�Z,dd� Z-dd� Z.dd � Z/d!d"� Z0 #dGd$d%�Z1dDd&d'�Z2d(d)� Z3d*d+� Z4dHd,d-�Z5d.d/� Z6dId0d1�Z7dId2d3�Z8dJd4d5�Z9dGd6d7�Z:dJd8d9�Z;dGd:d;�Z<d<d=� Z=d>d?� Z>dKdBdC�Z?dS )La� A module to manage software on Windows .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-override>`. The following functions require the existence of a :ref:`windows repository <windows-package-manager>` metadata DB, typically created by running :py:func:`pkg.refresh_db <salt.modules.win_pkg.refresh_db>`: - :py:func:`pkg.get_repo_data <salt.modules.win_pkg.get_repo_data>` - :py:func:`pkg.install <salt.modules.win_pkg.install>` - :py:func:`pkg.latest_version <salt.modules.win_pkg.latest_version>` - :py:func:`pkg.list_available <salt.modules.win_pkg.list_available>` - :py:func:`pkg.list_pkgs <salt.modules.win_pkg.list_pkgs>` - :py:func:`pkg.list_upgrades <salt.modules.win_pkg.list_upgrades>` - :py:func:`pkg.remove <salt.modules.win_pkg.remove>` If a metadata DB does not already exist and one of these functions is run, then one will be created from the repo SLS files that are present. As the creation of this metadata can take some time, the :conf_minion:`winrepo_cache_expire_min` minion config option can be used to suppress refreshes when the metadata is less than a given number of seconds old. .. note:: Version numbers can be ``version number string``, ``latest`` and ``Not Found``, where ``Not Found`` means this module was not able to determine the version of the software installed, it can also be used as the version number in sls definitions file in these cases. Versions numbers are sorted in order of 0, ``Not Found``, ``order version numbers``, ..., ``latest``. � N)� cmp_to_key)�CommandExecutionError�MinionError�SaltInvocationError�SaltRenderError��LooseVersion�pkgc C s t jj�� rtS dS )z9 Set the virtual pkg module if the os is Windows )Fz4Module win_pkg: module only works on Windows systems)�salt�utils�platformZ is_windows�__virtualname__� r r �H/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/win_pkg.py�__virtual__L s r c C s( zt | �|kW S ttfy Y dS w )a Return True if ``version_str`` parses to a float equal to ``version_float``. Used to match numeric ``version=`` arguments back to their string-keyed winrepo entries when the CLI YAML-parsed a value like ``3007.10`` into the float ``3007.1``. F)�float� TypeError� ValueError)�version_strZ version_floatr r r � _floats_equalU s �r c O s^ | sdS i }| D ]}d||<