@ -393,7 +393,7 @@ class YumModule(YumDnf):
self . lockfile = ' /var/run/yum.pid '
self . lockfile = ' /var/run/yum.pid '
def _enablerepos_with_error_checking ( self , yumbase ) :
def _enablerepos_with_error_checking ( self , yumbase ) :
# NOTE: This seems unintuitive, but it mirrors yum's CLI b a havior
# NOTE: This seems unintuitive, but it mirrors yum's CLI b e havior
if len ( self . enablerepo ) == 1 :
if len ( self . enablerepo ) == 1 :
try :
try :
yumbase . repos . enableRepo ( self . enablerepo [ 0 ] )
yumbase . repos . enableRepo ( self . enablerepo [ 0 ] )
@ -662,7 +662,7 @@ class YumModule(YumDnf):
pkgs = my . returnPackagesByDep ( req_spec ) + my . returnInstalledPackagesByDep ( req_spec )
pkgs = my . returnPackagesByDep ( req_spec ) + my . returnInstalledPackagesByDep ( req_spec )
except Exception as e :
except Exception as e :
# If a repo with `repo_gpgcheck=1` is added and the repo GPG
# If a repo with `repo_gpgcheck=1` is added and the repo GPG
# key was never accepted, quer ing this repo will throw an
# key was never accepted, quer y ing this repo will throw an
# error: 'repomd.xml signature could not be verified'. In that
# error: 'repomd.xml signature could not be verified'. In that
# situation we need to run `yum -y makecache` which will accept
# situation we need to run `yum -y makecache` which will accept
# the key and try again.
# the key and try again.
@ -962,7 +962,7 @@ class YumModule(YumDnf):
( name , ver , rel , epoch , arch ) = splitFilename ( envra )
( name , ver , rel , epoch , arch ) = splitFilename ( envra )
installed_pkgs = self . is_installed ( repoq , name )
installed_pkgs = self . is_installed ( repoq , name )
# case for two same envr but differ r ent archs like x86_64 and i686
# case for two same envr but differ ent archs like x86_64 and i686
if len ( installed_pkgs ) == 2 :
if len ( installed_pkgs ) == 2 :
( cur_name0 , cur_ver0 , cur_rel0 , cur_epoch0 , cur_arch0 ) = splitFilename ( installed_pkgs [ 0 ] )
( cur_name0 , cur_ver0 , cur_rel0 , cur_epoch0 , cur_arch0 ) = splitFilename ( installed_pkgs [ 0 ] )
( cur_name1 , cur_ver1 , cur_rel1 , cur_epoch1 , cur_arch1 ) = splitFilename ( installed_pkgs [ 1 ] )
( cur_name1 , cur_ver1 , cur_rel1 , cur_epoch1 , cur_arch1 ) = splitFilename ( installed_pkgs [ 1 ] )
@ -1146,7 +1146,7 @@ class YumModule(YumDnf):
installed = self . is_installed ( repoq , pkg )
installed = self . is_installed ( repoq , pkg )
if installed :
if installed :
# Return a mes age so it's obvious to the user why yum failed
# Return a mes s age so it's obvious to the user why yum failed
# and which package couldn't be removed. More details:
# and which package couldn't be removed. More details:
# https://github.com/ansible/ansible/issues/35672
# https://github.com/ansible/ansible/issues/35672
res [ ' msg ' ] = " Package ' %s ' couldn ' t be removed! " % pkg
res [ ' msg ' ] = " Package ' %s ' couldn ' t be removed! " % pkg
@ -1462,7 +1462,7 @@ class YumModule(YumDnf):
self . yum_basecmd . extend ( e_cmd )
self . yum_basecmd . extend ( e_cmd )
if self . state in ( ' installed ' , ' present ' , ' latest ' ) :
if self . state in ( ' installed ' , ' present ' , ' latest ' ) :
""" The need of this entire if conditional has to be cha la nged
""" The need of this entire if conditional has to be cha nged
this function is the ensure function that is called
this function is the ensure function that is called
in the main section .
in the main section .