
    VhS                    h    d dl mZ d dlmZ d dlmZ d dlmZ  e       Z e	d      Z
 G d de      Zy)	    )annotations)AnsibleActionFail)
ActionBase)Display)yumyum4dnfdnf4dnf5c                  $     e Zd ZdZd fd	Z xZS )ActionModuleFc                   d| _         d| _        t        t        |   ||      }~d| j
                  j                  v r#d| j
                  j                  v rt        d      | j
                  j                  j                  d| j
                  j                  j                  dd            }|dv re	 | j
                  j                  r3| j                  j                  d| j
                  j                  z        }n| j                  j                  d      }|t        vr| j                  d	t        d
d      |      }|j                  dd      rt        d|j                  d       |      t         j#                  d|z         |j                  di       j                  d
d      }| j
                  j                  r| j
                  j$                  r|dk7  rd|i|d<   |t        vr|j'                  ddd       |S |dv rd}d|z   }| j(                  j*                  j-                  |      s|j'                  dd|z  d       |S | j
                  j                  j/                         }d|v r|d= d|v r|d= t         j1                  d|z         |j'                  | j                  |||| j
                  j2                               |S # t        $ r Y w xY w)NTuseuse_backendz9parameters are mutually exclusive: ('use', 'use_backend')auto>   r   r   z.{{hostvars['%s']['ansible_facts']['pkg_mgr']}}z{{ansible_facts.pkg_mgr}}zansible.legacy.setupansible_pkg_mgrz!all)filtergather_subset)module_namemodule_args	task_varsfailedFzEFailed to fetch ansible_pkg_mgr to determine the dnf action backend: msg)resultzFacts %sansible_factspkg_mgr)zfCould not detect which major revision of dnf is in use, which is required to determine module backend.zdYou should manually specify use_backend to tell the module whether to use the dnf4 or dnf5 backend}))r   r   >   r
   r   r	   zansible.legacy.z+Could not find a dnf module backend for %s.z3Running %s as the backend for the dnf action plugin)r   r   r   
wrap_async)_supports_check_mode_supports_asyncsuperr   run_taskargsr   getdelegate_to_templartemplate	ExceptionVALID_BACKENDS_execute_moduledictdisplaydebugdelegate_factsupdate_shared_loader_objmodule_loader
has_plugincopyvvvv	async_val)selftmpr   r   modulefactsnew_module_args	__class__s          J/home/dcms/DCMS/lib/python3.12/site-packages/ansible/plugins/action/dnf.pyr!   zActionModule.run   s   $(!#|T.sI> DJJOO#(H#$_``$$UDJJOO,?,?v,VW_$::))!]]334dgkgqgqg}g}4}~F!]]334OPF '((2L]ms@t# ) %E yy5)'[\a\e\efk\l[mn  
 MM*u,-YY3778I6RFJJ**djj.G.GVW]M]+4f*=''MM"D8 ' )) '/F**88CCFK6cfl6lmn  #'**//"6"6"8 O3'6O+'.RU[[\d22 &Oyeieoeoeyey 3 { | a  s   /A$K 	KK)NN)__name__
__module____qualname__TRANSFERS_FILESr!   __classcell__)r;   s   @r<   r   r      s    OC C    r   N)
__future__r   ansible.errorsr   ansible.plugins.actionr   ansible.utils.displayr   r,   	frozensetr)   r    rB   r<   <module>rI      s3    # , - )
)ABG: GrB   