o nnh @s$ddlmZddlmZmZeed@ideddddedddd edddd edd d edddd deddddedd deddddeddddeddgddeddgddeddddeddddeddgddeddgddeddgddeddddedd d!d"d#d$edd ddedd d%eddd&ggd'd(edd d)edd*d+edddd,edddd-eddgd.d/d0eddd1gd2d3edd4dd5d6edd dd7edd dd8ed9d:dgd;gd%dgd d(ggd d<ZGd=d>d>ed?ZdS)A) annotations)ABCMetaabstractmethodallow_downgradeboolF)typedefault allowerasing)rr autoremovebest)rbugfix)requiredrr cacheonly conf_filestrdisable_excludesNdisable_gpg_checkdisable_pluginlist)relementsr disablerepo download_only download_dir enable_plugin enablerepoexclude installroot/install_repoqueryTz2.20zansible.builtin)rrremoved_in_versionremoved_from_collectioninstall_weak_depsnamepkg)rraliasesrnobest releasever)rsecurity skip_brokenstate)absent installedlatestpresentremoved)rrchoices update_cachez expire-cache)rrr$ update_onlyno)r rrvalidate_certs sslverify lock_timeoutint)r"rr0) argument_specrequired_one_ofmutually_exclusivesupports_check_modec@s,eZdZdZddZddZeddZdS) 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 cs||_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_ |jjd |_ |jjd |_ |jj d g|_ |jjd |_|jjd |_|jjd|_|jj dg|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_dd|jjdD|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd|_|jjd |_ |jjd!|_!|"|j|_|"|j |_ |"|j|_|"|j|_|jD]d"vrt#fd#d$d%Ds|j$d&d'q|jdur0|jr-d(|_nd)|_|jrD|jd(krF|jj$d*gd+dSdSdS),Nrr r r r rrrrrrrrrrrrrr!rcSg|]}|qSstrip).0pr>r>F/usr/local/lib/python3.10/dist-packages/ansible/module_utils/yumdnf.py [z#YumDnf.__init__..r"r%r&r'r(r)r1r0r3r4r5 c3s|]}|vVqdSNr>)rAspecr"r>rC qsz"YumDnf.__init__..)@><=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)rOresults)%moduleparamsrr r r r rrrrrgetrrrrrrrrr!rnamesr%r&r'r(r)r1r0r3r4r5!listify_comma_sep_strings_in_listany fail_json)selfrQr>rIrC__init__Csh "  zYumDnf.__init__cCsng}g}|D]}d|vr|||dd|dDq|D]}||q!|||dgkr5gS|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 ,cSr=r>r?)rAer>r>rCrDrEz.)appendextendsplitremove)rX some_listnew_listremove_from_original_listelementr>r>rCrUs    z(YumDnf.listify_comma_sep_strings_in_listcCstrG)NotImplementedError)rXr>r>rCrunsz YumDnf.runN)__name__ __module__ __qualname____doc__rYrUrrfr>r>r>rCr<<s Br<) metaclassr>) __future__rabcrrdictyumdnf_argument_specr<r>r>r>rCs                      ! " #%,