diff --git a/library/yum b/library/yum index 8d40a92788..5d38bcab32 100644 --- a/library/yum +++ b/library/yum @@ -409,6 +409,13 @@ def install(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos): # range requires or file-requires or pkgname :( else: + # most common case is the pkg is already installed and done + # short circuit all the bs - and search for it as a pkg in is_installed + # if you find it then we're done + if is_installed(module, repoq, spec, conf_file, en_repos=en_repos, dis_repos=dis_repos, is_pkg=True): + res['results'].append('%s providing %s is already installed' % (this, spec)) + continue + # look up what pkgs provide this pkglist = what_provides(module, repoq, spec, conf_file, en_repos=en_repos, dis_repos=dis_repos) if not pkglist: