- If retrieve_can_fail==True, return None instead of exception also when cacheonly.
- Save few lines by running cacheonly path after preload+checkMD. Preloading is no-op when using root cache, so we should never hit EPERM here. --- yum/yumRepo.py | 24 +++++++++--------------- 1 files changed, 9 insertions(+), 15 deletions(-) diff --git a/yum/yumRepo.py b/yum/yumRepo.py index 4648da9..c930d66 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -1707,27 +1707,21 @@ Insufficient space in download directory %s # got it, move along return local - if self.cache == 1: - if os.path.exists(local): - try: - self.checkMD(local, mdtype) - except URLGrabError, e: - raise Errors.RepoError, \ - "Caching enabled and local cache: %s does not match checksum" % local - else: - return local - - else: # ain't there - raise - raise Errors.RepoError, \ - "Caching enabled but no local cache of %s from %s" % (local, - self.ui_id) - if (os.path.exists(local) or self._preload_md_from_system_cache(os.path.basename(local))): if self._checkMD(local, mdtype, check_can_fail=True): self.retrieved[mdtype] = 1 return local # it's the same return the local one + if self.cache == 1: + if retrieve_can_fail: + return None + if os.path.exists(local): + msg = "Caching enabled and local cache: %s does not match checksum" % local + else: + msg = "Caching enabled but no local cache of %s from %s" % (local, self.ui_id) + raise Errors.RepoError, msg + try: def checkfunc(obj): self.checkMD(obj, mdtype) -- 1.7.4.4 _______________________________________________ Yum-devel mailing list Yum-devel@lists.baseurl.org http://lists.baseurl.org/mailman/listinfo/yum-devel