FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 03-24-2009, 02:22 PM
David Lehman
 
Default Use the mount and unmount methods on OpticalDevice.format now.

On Tue, 2009-03-24 at 10:43 -0400, Chris Lumens wrote:
> ---
> image.py | 11 +++++------
> yuminstall.py | 19 ++++++++++---------
> 2 files changed, 15 insertions(+), 15 deletions(-)


Looks good.

>
> diff --git a/image.py b/image.py
> index c77d923..29ab10b 100644
> --- a/image.py
> +++ b/image.py
> @@ -255,8 +255,7 @@ def scanForMedia(tree, storage):
> continue
>
> try:
> - if isys.mount(dev.path, tree, fstype="iso9660", readOnly=True):
> - continue
> + dev.format.mount(mountpoint=tree)
> except:
> continue
>
> @@ -273,13 +272,13 @@ def umountImage(tree, currentMedia):
> isys.umount(tree, removeDir=False)
> isys.unlosetup("/dev/loop1")
>
> -def unmountCD(path, messageWindow):
> - if not path:
> +def unmountCD(dev, messageWindow):
> + if not dev:
> return
>
> while True:
> try:
> - isys.umount(path, removeDir=False)
> + dev.format.unmount()
> break
> except Exception, e:
> log.error("exception in _unmountCD: %s" %(e,))
> @@ -288,7 +287,7 @@ def unmountCD(path, messageWindow):
> "Please make sure you're not accessing "
> "%s from the shell on tty2 "
> "and then click OK to retry.")
> - % (path,))
> + % (dev.path,))
>
> def verifyMedia(tree, discnum, timestamp=None):
> if os.access("%s/.discinfo" % tree, os.R_OK):
> diff --git a/yuminstall.py b/yuminstall.py
> index 3bcb78d..dc2dde5 100644
> --- a/yuminstall.py
> +++ b/yuminstall.py
> @@ -322,27 +322,28 @@ class AnacondaYum(YumSorter):
> self._timestamp = f.readline().strip()
> f.close()
>
> + dev = self.anaconda.id.storage.devicetree.getDeviceByNam e(self.anaconda.mediaDevice)
> + dev.format.mountpoint = self.tree
> +
> # If self.currentMedia is None, then there shouldn't be anything
> # mounted. Before going further, see if the correct disc is already
> # in the drive. This saves a useless eject and insert if the user
> # has for some reason already put the disc in the drive.
> if self.currentMedia is None:
> try:
> - isys.mount(self.anaconda.mediaDevice, self.tree,
> - fstype="iso9660", readOnly=True)
> + dev.format.mount()
>
> if verifyMedia(self.tree, discnum, None):
> self.currentMedia = discnum
> return
>
> - isys.umount(self.tree)
> + dev.format.unmount()
> except:
> pass
> else:
> - unmountCD(self.tree, self.anaconda.intf.messageWindow)
> + unmountCD(dev, self.anaconda.intf.messageWindow)
> self.currentMedia = None
>
> - dev = self.anaconda.id.storage.devicetree.getDeviceByNam e(self.anaconda.mediaDevice)
> dev.eject()
>
> while True:
> @@ -354,8 +355,7 @@ class AnacondaYum(YumSorter):
> discnum))
>
> try:
> - isys.mount(self.anaconda.mediaDevice, self.tree,
> - fstype = "iso9660", readOnly = True)
> + dev.format.mount()
>
> if verifyMedia(self.tree, discnum, self._timestamp):
> self.currentMedia = discnum
> @@ -364,8 +364,9 @@ class AnacondaYum(YumSorter):
> self.anaconda.intf.messageWindow(_("Wrong Disc"),
> _("That's not the correct %s disc.")
> % (productName,))
> - isys.umount(self.tree)
> - isys.ejectCdrom(self.anaconda.mediaDevice)
> +
> + dev.format.unmount()
> + dev.eject()
> except:
> self.anaconda.intf.messageWindow(_("Error"),
> _("Unable to access the disc."))

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

Thread Tools




All times are GMT. The time now is 02:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org