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

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