# 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()):
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
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list