[PATCH] Remove all uses of isys.cdromList, which no longer exists.

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

 



---
 anaconda       |   10 ++++++----
 image.py       |   14 +++++++-------
 iw/task_gui.py |    4 ++--
 yuminstall.py  |    2 +-
 4 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/anaconda b/anaconda
index 0244ad6..fc32dfb 100755
--- a/anaconda
+++ b/anaconda
@@ -1016,10 +1016,12 @@ if __name__ == "__main__":
         handleException(anaconda, sys.exc_info())
 
     if anaconda.isKickstart and anaconda.id.ksdata.reboot.eject:
-        isys.flushDriveDict()
-        for drive in isys.cdromList():
-            log.info("attempting to eject %s" % drive)
-            isys.ejectCdrom(drive)
+        for drive in anaconda.id.storage.devicetree.devices.values():
+            if drive.type != "cdrom":
+                continue
+
+            log.info("attempting to eject %s" % drive.path)
+            isys.ejectCdrom(drive.path)
 
     del anaconda.intf
 
diff --git a/image.py b/image.py
index fc687fd..83e74db 100644
--- a/image.py
+++ b/image.py
@@ -249,12 +249,13 @@ def presentRequiredMediaMessage(anaconda):
 
 # Find an attached CD/DVD drive with media in it that contains packages,
 # and return that device name.
-def scanForMedia(tree):
-    drive = None
+def scanForMedia(tree, storage):
+    for dev in storage.devicetree.devices.values():
+        if dev.type != "cdrom":
+            continue
 
-    for cdr in map(lambda d: "/dev/%s" % d, isys.cdromList()):
         try:
-            if isys.mount(cdr, tree, fstype="iso9660", readOnly=1):
+            if isys.mount(dev.path, tree, fstype="iso9660", readOnly=1):
                 continue
         except:
             continue
@@ -263,10 +264,9 @@ def scanForMedia(tree):
             isys.umount(tree)
             continue
 
-        drive = cdr
-        break
+        return dev.path
 
-    return drive
+    return None
 
 def umountImage(tree, currentMedia):
     if currentMedia is not None:
diff --git a/iw/task_gui.py b/iw/task_gui.py
index 04032d3..5f688f5 100644
--- a/iw/task_gui.py
+++ b/iw/task_gui.py
@@ -268,7 +268,7 @@ class RepoEditor:
         return True
 
     def _applyMedia(self, repo):
-        cdr = scanForMedia(self.anaconda.backend.ayum.tree)
+        cdr = scanForMedia(self.anaconda.backend.ayum.tree, self.anaconda.id.storage)
         if not cdr:
             self.intf.messageWindow(_("No Media Found"),
                                     _("No installation media was found. "
@@ -393,7 +393,7 @@ class RepoMethodstrEditor(RepoEditor):
         return repourl
 
     def _applyMedia(self):
-        cdr = scanForMedia(self.anaconda.backend.ayum.tree)
+        cdr = scanForMedia(self.anaconda.backend.ayum.tree, self.anaconda.id.storage)
         if not cdr:
             self.intf.messageWindow(_("No Media Found"),
                                     _("No installation media was found. "
diff --git a/yuminstall.py b/yuminstall.py
index 4135815..9ce4883 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -444,7 +444,7 @@ class AnacondaYum(YumSorter):
             # we should first check to see if there's a CD/DVD with packages
             # on it, and then default to the mirrorlist URL.  The user can
             # always change the repo with the repo editor later.
-            cdr = scanForMedia(self.tree)
+            cdr = scanForMedia(self.tree, self.anaconda.id.storage)
             if cdr:
                 self.mediagrabber = self.mediaHandler
                 self.anaconda.mediaDevice = cdr
-- 
1.6.1.3

_______________________________________________
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