yumpkg.py: add option to the command "check-update"

This commit is contained in:
Guillaume DUBROEUCQ 2017-07-27 14:34:56 +02:00
parent e931ed2517
commit a96f7c09e0

View file

@ -896,7 +896,13 @@ def refresh_db(**kwargs):
branch_arg = _get_branch_option(**kwargs)
clean_cmd = [_yum(), '--quiet', 'clean', 'expire-cache']
update_cmd = [_yum(), '--quiet', 'check-update']
if __grains__.get('os_family') == 'RedHat' and __grains__.get('osmajorrelease') == '7':
# This feature is disabled because it is not used by Salt. Furthermore, this feature lasts a lot with using large repo like EPEL
update_cmd = [_yum(), '--quiet', '--setopt=autocheck_running_kernel=false', 'check-update']
else:
update_cmd = [_yum(), '--quiet', 'check-update']
for args in (repo_arg, exclude_arg, branch_arg):
if args:
clean_cmd.extend(args)