[PATCH 1/2] Deal with media only for media repo package failures (#573492)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This should take care e.g. of the case when hd: or cdrom: repo
and additional non-media repo is used and download of package from
non-media repo fails which would lead to traceback.

The anacondaBaseURLs repo property is quite new in the repo code,
so now we can take advantage of having it there.
---
 yuminstall.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index 2ada820..17cb2d1 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -783,7 +783,7 @@ class AnacondaYum(YumSorter):
                 continue
 
     def _handleFailure(self, package):
-        if not self.isodir and self.currentMedia:
+        if package.repo.anacondaBaseURLs[0].startswith("cdrom:"):
             buttons = [_("Re_boot"), _("_Eject")]
         else:
             buttons = [_("Re_boot"), _("_Retry")]
@@ -805,7 +805,7 @@ class AnacondaYum(YumSorter):
             if os.path.exists(package.localPkg()):
                 os.unlink(package.localPkg())
 
-            if not self.isodir and self.currentMedia:
+            if package.repo.anacondaBaseURLs[0].startswith("cdrom:"):
                 self._switchCD(self.currentMedia)
             else:
                 return
@@ -816,12 +816,12 @@ class AnacondaYum(YumSorter):
         # which mirror we were on when we started this particular download. 
         # Whenever we have run out of mirrors the grabber's get/open/retrieve
         # method will raise a URLGrabError exception with errno 256.
-        grab = self.repos.getRepo(kwargs["repo"]).grab
+        repo = self.repos.getRepo(kwargs["repo"])
         log.warning("Failed to get %s from mirror %d/%d, "
-                    "or downloaded file is corrupt" % (obj.url, grab._next + 1,
-                                                       len(grab.mirrors)))
+                    "or downloaded file is corrupt" % (obj.url, repo.grab._next + 1,
+                                                       len(repo.grab.mirrors)))
 
-        if self.currentMedia:
+        if repo.anacondaBaseURLs[0].startswith("cdrom:"):
             dev = self.anaconda.storage.devicetree.getDeviceByName(self.anaconda.mediaDevice)
             dev.format.mountpoint = self.tree
             unmountCD(dev, self.anaconda.intf.messageWindow)
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux