mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-23 14:31:44 -07:00
Move update_cache to after self.yum_baseurl definition (#56613)
This commit is contained in:
parent
a4144e15c0
commit
e13566140a
1 changed files with 11 additions and 11 deletions
|
@ -1509,6 +1509,17 @@ class YumModule(YumDnf):
|
||||||
if error_msgs:
|
if error_msgs:
|
||||||
self.module.fail_json(msg='. '.join(error_msgs))
|
self.module.fail_json(msg='. '.join(error_msgs))
|
||||||
|
|
||||||
|
# fedora will redirect yum to dnf, which has incompatibilities
|
||||||
|
# with how this module expects yum to operate. If yum-deprecated
|
||||||
|
# is available, use that instead to emulate the old behaviors.
|
||||||
|
if self.module.get_bin_path('yum-deprecated'):
|
||||||
|
yumbin = self.module.get_bin_path('yum-deprecated')
|
||||||
|
else:
|
||||||
|
yumbin = self.module.get_bin_path('yum')
|
||||||
|
|
||||||
|
# need debug level 2 to get 'Nothing to do' for groupinstall.
|
||||||
|
self.yum_basecmd = [yumbin, '-d', '2', '-y']
|
||||||
|
|
||||||
if self.update_cache and not self.names and not self.list:
|
if self.update_cache and not self.names and not self.list:
|
||||||
rc, stdout, stderr = self.module.run_command(self.yum_basecmd + ['clean', 'expire-cache'])
|
rc, stdout, stderr = self.module.run_command(self.yum_basecmd + ['clean', 'expire-cache'])
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
|
@ -1526,17 +1537,6 @@ class YumModule(YumDnf):
|
||||||
results=[stderr],
|
results=[stderr],
|
||||||
)
|
)
|
||||||
|
|
||||||
# fedora will redirect yum to dnf, which has incompatibilities
|
|
||||||
# with how this module expects yum to operate. If yum-deprecated
|
|
||||||
# is available, use that instead to emulate the old behaviors.
|
|
||||||
if self.module.get_bin_path('yum-deprecated'):
|
|
||||||
yumbin = self.module.get_bin_path('yum-deprecated')
|
|
||||||
else:
|
|
||||||
yumbin = self.module.get_bin_path('yum')
|
|
||||||
|
|
||||||
# need debug level 2 to get 'Nothing to do' for groupinstall.
|
|
||||||
self.yum_basecmd = [yumbin, '-d', '2', '-y']
|
|
||||||
|
|
||||||
repoquerybin = self.module.get_bin_path('repoquery', required=False)
|
repoquerybin = self.module.get_bin_path('repoquery', required=False)
|
||||||
|
|
||||||
if self.install_repoquery and not repoquerybin and not self.module.check_mode:
|
if self.install_repoquery and not repoquerybin and not self.module.check_mode:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue