Blame SOURCES/BZ-1510495-yumRepo-migrate-more-prints-to-logging.patch

5ab7f2
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
5ab7f2
index eeeacab1..1e0e9135 100644
5ab7f2
--- a/yum/yumRepo.py
5ab7f2
+++ b/yum/yumRepo.py
5ab7f2
@@ -836,9 +836,9 @@ class YumRepository(Repository, config.RepoConf):
5ab7f2
                     try:
5ab7f2
                         misc.unlink_f(self.mirrorlist_file)
5ab7f2
                     except (IOError, OSError), e:
5ab7f2
-                        print 'Could not delete bad mirrorlist file: %s - %s' % (self.mirrorlist_file, e)
5ab7f2
+                        logger.error('Could not delete bad mirrorlist file: %s - %s' % (self.mirrorlist_file, e))
5ab7f2
                     else:
5ab7f2
-                        print 'removing mirrorlist with no valid mirrors: %s' % self.mirrorlist_file
5ab7f2
+                        logger.warning('removing mirrorlist with no valid mirrors: %s' % self.mirrorlist_file)
5ab7f2
         # store them all back in baseurl for compat purposes
5ab7f2
         self.baseurl = self._urls
5ab7f2
         self.check()
5ab7f2
@@ -868,9 +868,9 @@ class YumRepository(Repository, config.RepoConf):
5ab7f2
         if skipped is not None:
5ab7f2
             # Caller cleans up for us.
5ab7f2
             if goodurls:
5ab7f2
-                print 'YumRepo Warning: Some mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped)
5ab7f2
+                logger.warning('YumRepo Warning: Some mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped))
5ab7f2
             else: # And raises in this case
5ab7f2
-                print 'YumRepo Error: All mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped)
5ab7f2
+                logger.error('YumRepo Error: All mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped))
5ab7f2
         return goodurls
5ab7f2
 
5ab7f2
     def _geturls(self):
5ab7f2
@@ -900,7 +900,7 @@ class YumRepository(Repository, config.RepoConf):
5ab7f2
                         raise Errors.RepoError, msg
5ab7f2
                     #  Now, we have an old usable metalink, so we can't move to
5ab7f2
                     # a newer repomd.xml ... or checksums won't match.
5ab7f2
-                    print "Could not get metalink %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1]))                    
5ab7f2
+                    logger.error("Could not get metalink %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1])))
5ab7f2
                     self._metadataCurrent = True
5ab7f2
 
5ab7f2
             if not self._metadataCurrent:
5ab7f2
@@ -909,7 +909,7 @@ class YumRepository(Repository, config.RepoConf):
5ab7f2
                     shutil.move(result, self.metalink_filename)
5ab7f2
                 except metalink.MetaLinkRepoErrorParseFail, e:
5ab7f2
                     # Downloaded file failed to parse, revert (dito. above):
5ab7f2
-                    print "Could not parse metalink %s error was \n%s"%(url, e)
5ab7f2
+                    logger.error("Could not parse metalink %s error was \n%s" % (url, e))
5ab7f2
                     self._metadataCurrent = True
5ab7f2
                     misc.unlink_f(result)
5ab7f2
 
5ab7f2
@@ -1966,7 +1966,7 @@ Insufficient space in download directory %s
5ab7f2
             except Exception, e:
5ab7f2
                 if url is None: # Shouldn't happen
5ab7f2
                     url = "<unknown>"
5ab7f2
-                print "Could not read mirrorlist %s, error was \n%s" %(url, e)
5ab7f2
+                logger.error("Could not read mirrorlist %s, error was \n%s" % (url, e))
5ab7f2
                 content = []
5ab7f2
             for line in content:
5ab7f2
                 if not re.match('\w+://\S+\s*$', line):
5ab7f2
@@ -2003,7 +2003,7 @@ Insufficient space in download directory %s
5ab7f2
             try:
5ab7f2
                 fo = urlgrabber.grabber.urlopen(url, **ugopts)
5ab7f2
             except URLGrabError, e:
5ab7f2
-                print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1]))
5ab7f2
+                logger.error("Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1])))
5ab7f2
                 fo = None
5ab7f2
 
5ab7f2
         (returnlist, content) = self._readMirrorList(fo, url)