File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/solarisipspkg.cpython-310.pyc
Back
o ;j�J � @ s d Z ddlZddlZddlZddlZddlZddlZddlm Z dZ e�e�Z dd� Zddd d ddd dd�Zdd� Zdd� Zd5dd�Zdd� Zd6dd�Zd5dd�Zdd� Zd5d d!�Zd"d#� Zd$d%� Zejj�ed&�Zd'd(� Zd)d*� Zd+d,� Z d5d-d.�Z!d7d/d0�Z"d8d1d2�Z#d3d4� Z$dS )9a IPS pkg support for Solaris .. 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>`. This module provides support for Solaris 11 new package management - IPS (Image Packaging System). This is the default pkg module for Solaris 11 (and later). If you want to use also other packaging module (e.g. pkgutil) together with IPS, you need to override the ``pkg`` provider in sls for each package: .. code-block:: yaml mypackage: pkg.installed: - provider: pkgutil Or you can override it globally by setting the :conf_minion:`providers` parameter in your Minion config file like this: .. code-block:: yaml providers: pkg: pkgutil Or you can override it globally by setting the :conf_minion:`providers` parameter in your Minion config file like this: .. code-block:: yaml providers: pkg: pkgutil � N)�CommandExecutionError�pkgc C s2 t d dkrtt d �dkrtjj�d�rtS dS )z< Set the virtual pkg module if the os is Solaris 11 Z os_family�SolarisZ kernelreleasegffffff@r )FzPThe solarisips execution module failed to load: only available on Solaris >= 11.)Z __grains__�float�salt�utils�path�which�__virtualname__� r r �N/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/solarisipspkg.py�__virtual__4 s �r zCommand succeeded.zAn error occurred.z,Invalid command line options were specified.zDMultiple operations were requested, but only some of them succeeded.z%No changes were made - nothing to do.z=The requested operation cannot be performed on a live image.z�The requested operation cannot be completed because the licenses for the packages being installed or updated have not been accepted.zHThe image is currently in use by another process and cannot be modified.)r � � � � � � � c C s | � � d � d�d �� S )aG Extracts package name from "pkg list -v" output. Input: one line of the command output Output: pkg name (e.g.: "pkg://solaris/x11/library/toolkit/libxt") Example use: line = "pkg://solaris/x11/library/toolkit/libxt@1.1.3,5.11-0.175.1.0.0.24.1317:20120904T180030Z i--" name = _ips_get_pkgname(line) r �@��split�strip��liner r r �_ips_get_pkgnameT � r c C s | � � d � d�d �� S )a\ Extracts package version from "pkg list -v" output. Input: one line of the command output Output: package version (e.g.: "1.1.3,5.11-0.175.1.0.0.24.1317:20120904T180030Z") Example use: line = "pkg://solaris/x11/library/toolkit/libxt@1.1.3,5.11-0.175.1.0.0.24.1317:20120904T180030Z i--" name = _ips_get_pkgversion(line) r r r r r r r r �_ips_get_pkgversion` r r Fc K s2 t jj�t� | rtd d�dkS td d�dkS )a1 Updates the remote repos database. full : False Set to ``True`` to force a refresh of the pkg DB from all publishers, regardless of the last refresh time. CLI Example: .. code-block:: bash salt '*' pkg.refresh_db salt '*' pkg.refresh_db full=True �cmd.retcodez/bin/pkg refresh --fullr z/bin/pkg refresh)r r r Z clear_rtagZ__opts__�__salt__)�full�kwargsr r r � refresh_dbl s r"