Beispiel #1
0
def find_optical_install_media(storage):
    """Find a device with a valid optical install media.

    Return the first device containing a valid optical install
    media for this product.

    :param storage: an instance of Blivet's storage
    :return: a device or None
    """
    for dev in find_optical_media(storage.devicetree):
        mountpoint = tempfile.mkdtemp()

        try:
            try:
                payload_utils.mount_device(dev, mountpoint)
            except FSError:
                continue
            try:
                if not verifyMedia(mountpoint):
                    continue
            finally:
                payload_utils.unmount_device(dev, mountpoint)
        finally:
            os.rmdir(mountpoint)

        return dev

    return None
Beispiel #2
0
    def find_optical_media(self):
        """Find all devices with mountable optical media.

        :return: a list of device names
        """
        devices = find_optical_media(self.storage.devicetree)
        return [d.name for d in devices]
Beispiel #3
0
    def find_optical_media(self):
        """Find all devices with mountable optical media.

        :return: a list of device names
        """
        devices = find_optical_media(self.storage.devicetree)
        return [d.name for d in devices]