
    Vh                    ,   d dl mZ d dlmZmZ  e ed@i d edd      d edd      d	 edd      d
 ed      d eddd      d edd      d ed      d edd      d edd      d eddg       d eddg       d edd      d edd      d eddg       d eddg       d eddg       d edd      d edd d!d"#      d$ edd       d ed      d% eddd&gg '      d( ed      d) ed*      d+ edd      d, edd      d- eddg d./      d0 eddd1g2      d3 edd4d5      d6 edd       d7 edd       d8 ed9d:      g d;gd%dgd
d(ggd <      Z G d= d>e?      Zy)A    )annotations)ABCMetaabstractmethodallow_downgradeboolF)typedefaultallowerasing)r	   r   
autoremovebest)r   bugfix)requiredr   r	   	cacheonly	conf_filestrdisable_excludesNdisable_gpg_checkdisable_pluginlist)r   elementsr	   disablerepodownload_onlydownload_direnable_plugin
enablerepoexcludeinstallroot/install_repoqueryTz2.20zansible.builtin)r   r	   removed_in_versionremoved_from_collectioninstall_weak_depsnamepkg)r   r   aliasesr	   nobest
releasever)r	   securityskip_brokenstate)absent	installedlatestpresentremoved)r   r	   choicesupdate_cachezexpire-cache)r   r	   r%   update_onlyno)r   r	   r   validate_certs	sslverifylock_timeoutint   )r#   r   r1   )argument_specrequired_one_ofmutually_exclusivesupports_check_modec                  ,    e Zd ZdZd Zd Zed        Zy)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
    c                

   || _         | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _	        | j                   j                  d	   | _
        | j                   j                  d
   | _        | j                   j                  j                  dg       | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  j                  dg       | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   D cg c]  }|j/                          c}| _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _        | j                   j                  d   | _         | j                   j                  d   | _!        | j                   j                  d   | _"        | jG                  | j0                        | _        | jG                  | j                        | _        | jG                  | j"                        | _        | jG                  | j$                        | _        | j0                  D ].  d v stI        fd!d"D              r|jK                  d#$       0 | j:                  | j                  rd%| _        nd&| _        | j                  r.| j:                  d%k7  r| j                   jK                  d'g (       y y y c c}w ))Nr   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r"   r   r#   r&   r'   r(   r)   r*   r2   r1   r4   r5   r6    c              3  &   K   | ]  }|v  
 y wN ).0specr#   s     K/home/dcms/DCMS/lib/python3.12/site-packages/ansible/module_utils/yumdnf.py	<genexpr>z"YumDnf.__init__.<locals>.<genexpr>q   s     &Utt|&Us   )@><=zIt 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.)msgr+   r.   z4Autoremove should be used alone or with state=absent)rL   results)&moduleparamsr   r
   r   r   r   r   r   r   r   r   getr   r   r   r   r   r   r   r   r"   r   stripnamesr&   r'   r(   r)   r*   r2   r1   r4   r5   r6   !listify_comma_sep_strings_in_listany	fail_json)selfrN   pr#   s      @rF   __init__zYumDnf.__init__C   s   #{{112CD KK..~>++,,\:KK&&v.	kk((2++K8++K8 $ 2 23E F!%!3!34G!H"kk001AB;;--11-D![[//@ KK..~>![[//@++,,00rB{{)))4;;--m<!%!3!34G!H!%!3!34G!HKK&&v.	)-););F)CDAaggiD
kk((2++,,\:**:6;;--m<[[''0
;;--m< KK..~>"kk001AB++K8 KK..~> ;;DJJG
AA$BRBRS@@Q==dllK JJ 	Dd{3&U@T&U#U  D ! 	 ::%
&
??

h 6KK!!J "  !7?I Es   T c                ,   g }g }|D ]T  }d|v s|j                  |       |j                  |j                  d      D cg c]  }|j                          c}       V |D ]  }|j	                  |        |j                  |       |dgk(  rg S |S c c}w )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
        , )appendextendsplitrQ   remove)rV   	some_listnew_listremove_from_original_listelementes         rF   rS   z(YumDnf.listify_comma_sep_strings_in_list   s     $&!  	IGg~)009GMM#4F Gq GH	I
 1 	&GW%	& 	"I !Hs   B
c                    t         rB   )NotImplementedError)rV   s    rF   runz
YumDnf.run   s    !!    N)__name__
__module____qualname____doc__rX   rS   r   rg   rC   rh   rF   r>   r>   <   s'    @D. " "rh   r>   )	metaclassrC   )
__future__r   abcr   r   dictyumdnf_argument_specr>   rC   rh   rF   <module>rr      s|   # ' $&%8$%f5$ VU3$ v	$
 U?$ FE2$ E"$ 5$7$ FE:$ %D$ fubA$ 6$ ud3$ C$ VeR@$  &5"=!$" eS1#$$ %?P
%$, FD9-$. u/$0 vwK1$2  3$4 %5$6 6517$8 fe49$< t5lm=$> vu~>NO?$@ %FCA$B 6C$D FD1E$F ub1G$J 66(68*<=Q) Xb"w b"rh   