diff options
author | Chris Lumens <clumens@redhat.com> | 2009-03-13 13:34:13 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-03-13 14:26:57 -0400 |
commit | 12c4fb21429e61fc0dedbd8e3fd2a2f0d3e3eeac (patch) | |
tree | 49266004e7465b89547982458ed990675cb95cba /isys/isys.py | |
parent | 4f7ad077b523a0dbb1ace6339720f875dec6574f (diff) | |
download | anaconda-12c4fb21429e61fc0dedbd8e3fd2a2f0d3e3eeac.tar.gz anaconda-12c4fb21429e61fc0dedbd8e3fd2a2f0d3e3eeac.tar.xz anaconda-12c4fb21429e61fc0dedbd8e3fd2a2f0d3e3eeac.zip |
Add mediaPresent and eject to the OpticalDevice class.
These no longer belong in isys.py as putting them in the classes is much
more correct. I also put a mediaPresent method on Device in general.
This will come in handy when we start dealing with USB CF readers and
similar devices that can be present without having media.
Diffstat (limited to 'isys/isys.py')
-rwxr-xr-x | isys/isys.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/isys/isys.py b/isys/isys.py index fb2fa5d57..07c69a0a1 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -437,22 +437,6 @@ def ext2HasJournal(device): hasjournal = _isys.e2hasjournal(device); return hasjournal -def ejectCdrom(device): - # XXX this should go into storage.devices.OpticalDevice - if not os.path.exists(device): - device = "/dev/%s" % device - - fd = os.open(device, os.O_RDONLY|os.O_NONBLOCK) - - # this is a best effort - try: - _isys.ejectcdrom(fd) - except SystemError, e: - log.warning("error ejecting cdrom (%s): %s" %(device, e)) - pass - - os.close(fd) - def driveUsesModule(device, modules): """Returns true if a drive is using a prticular module. Only works for SCSI devices right now.""" @@ -481,23 +465,6 @@ def driveUsesModule(device, modules): pass return rc -## Check if a removable media drive (CD, USB key, etc.) has media present. -# @param device The basename of the device node. -# @return True if media is present in device, False otherwise. -def mediaPresent(device): - # XXX this should go into storage.devices.RemovableDevice or similar - try: - fd = os.open("/dev/%s" % device, os.O_RDONLY) - except OSError, (errno, strerror): - # error 123 = No medium found - if errno == 123: - return False - else: - return True - else: - os.close(fd) - return True - def driveIsIscsi(device): # ewww. just ewww. if not os.path.islink("/sys/block/%s/device" %(device,)): |