summaryrefslogtreecommitdiffstats
path: root/yuminstall.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-03-19 14:53:04 -0400
committerChris Lumens <clumens@redhat.com>2008-03-19 16:08:43 -0400
commitf40b0140c4b30c3bfffaf1bae8b17ae3fbf36ba2 (patch)
tree84d0f9a3bb9b378124422cab92057bafa5a5d293 /yuminstall.py
parent83ec01bc70e646b831de344e983c3be977f9478a (diff)
downloadanaconda-f40b0140c4b30c3bfffaf1bae8b17ae3fbf36ba2.tar.gz
anaconda-f40b0140c4b30c3bfffaf1bae8b17ae3fbf36ba2.tar.xz
anaconda-f40b0140c4b30c3bfffaf1bae8b17ae3fbf36ba2.zip
Make sure the first disc image is mounted before setting up repos.
Diffstat (limited to 'yuminstall.py')
-rw-r--r--yuminstall.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/yuminstall.py b/yuminstall.py
index d58cfa4dd..091a6cd94 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -268,6 +268,7 @@ class AnacondaYum(YumSorter):
def __init__(self, anaconda):
YumSorter.__init__(self)
self.anaconda = anaconda
+ self.currentMedia = None
self._loopbackFile = None
self._timestamp = None
@@ -280,7 +281,7 @@ class AnacondaYum(YumSorter):
# directory where Packages/ is located.
self.tree = "/mnt/source"
- if self.anaconda.methodstr.startswith("hd:"):
+ if self.anaconda.methodstr.startswith("hd:") or self.anaconda.methodstr.startswith("nfsiso:"):
self.isodir = "/mnt/isodir"
else:
self.isodir = None
@@ -291,11 +292,10 @@ class AnacondaYum(YumSorter):
if os.path.ismount(self.tree):
self.currentMedia = 1
else:
- self.currentMedia = None
+ self._switchImage(1)
self.mediagrabber = self.mediaHandler
else:
- self.currentMedia = None
self.mediagrabber = None
self.doConfigSetup(root=anaconda.rootPath)
@@ -411,6 +411,20 @@ class AnacondaYum(YumSorter):
self.anaconda.intf.messageWindow(_("Error"),
_("Unable to access the disc."))
+ def _switchImage(self, discnum):
+ umountImage(self.tree, self.currentMedia)
+ self.currentMedia = None
+
+ # mountDirectory checks before doing anything, so it's safe to
+ # call this repeatedly.
+ mountDirectory(self.isodir, self.anaconda.methodstr,
+ self.anaconda.intf.messageWindow)
+
+ self._discImages = mountImage(self.isodir, self.tree, discnum,
+ self.anaconda.intf.messageWindow,
+ discImages=self._discImages)
+ self.currentMedia = discnum
+
def mediaHandler(self, *args, **kwargs):
mediaid = kwargs["mediaid"]
discnum = kwargs["discnum"]
@@ -424,18 +438,7 @@ class AnacondaYum(YumSorter):
# Unmount any currently mounted ISO images and mount the one
# containing the requested packages.
if self.isodir:
- umountImage(self.tree, self.currentMedia)
- self.currentMedia = None
-
- # mountDirectory checks before doing anything, so it's safe to
- # call this repeatedly.
- mountDirectory(self.isodir, self.anaconda.methodstr,
- self.anaconda.intf.messageWindow)
-
- discImages = mountImage(self.isodir, self.tree, discnum,
- self.anaconda.intf.messageWindow,
- discImages=self._discImages)
- self.currentMedia = discnum
+ self._switchImage(discnum)
else:
self._switchCD(discnum)
@@ -460,8 +463,6 @@ class AnacondaYum(YumSorter):
isys.mount(self.anaconda.methodstr[4:], self.tree, "nfs")
elif self.anaconda.methodstr.startswith("nfsiso:"):
methodstr = "file://%s" % self.tree
- if not os.path.ismount(self.tree):
- isys.mount(self.anaconda.methodstr[7:], self.tree, "nfs")
elif self.anaconda.methodstr.startswith("cdrom:"):
methodstr = "file://%s" % self.tree
elif self.anaconda.methodstr.startswith("hd:"):