Esempio n. 1
0
def openFileURL(url):
    filePath = url[7:]

    if filePath.startswith(consts.MEDIA_DEVICE_MOUNT_POINT):
        import media  # Import here to avoid a loop.
        media.runtimeActionMountMedia()

    if not filePath.startswith('/'):
        log.warn('Do not support hosts specified in file:// URLs')
        log.warn('Assuming the user meant to put in a third /')
        filePath = '/' + filePath
    try:
        return open(filePath)
    except IOError, ex:
        log.error('File %s specified in URL %s could not be opened (%s)' %
                  (filePath, url, str(ex)))
        raise
Esempio n. 2
0
def openFileURL(url):
    filePath = url[7:]

    if filePath.startswith(consts.MEDIA_DEVICE_MOUNT_POINT):
        import media # Import here to avoid a loop.
        media.runtimeActionMountMedia()
    
    if not filePath.startswith('/'):
        log.warn('Do not support hosts specified in file:// URLs')
        log.warn('Assuming the user meant to put in a third /')
        filePath = '/' + filePath
    try:
        return open(filePath)
    except IOError, ex:
        log.error('File %s specified in URL %s could not be opened (%s)'
                  % (filePath, url, str(ex)))
        raise
Esempio n. 3
0
def _sourceOption(match):
    '''Handle the "source=<path>" option.'''
    path = match.group(1)

    # If the CD is in a drive that is only detected after all the drivers are
    # loaded then we need to rerun the script that finds the install CD.
    if not os.path.exists(path):
        media.runtimeActionMountMedia()
    if not os.path.exists(path):
        failWithLog("error: cannot find source -- %s\n" % path)

    if path == CDROM_DEVICE_PATH:
        pass
    else:
        userchoices.setMediaDescriptor(media.MediaDescriptor(
                partPath=path, partFsName="iso9660"))
    
    return []
Esempio n. 4
0
 def getNext(self):
     # Make sure the media is mounted before the user leaves the machine
     # unattended for the actual install.
     media.runtimeActionMountMedia()
Esempio n. 5
0
 def getNext(self):
     # Make sure the media is mounted before the user leaves the machine
     # unattended for the actual install.
     media.runtimeActionMountMedia()
Esempio n. 6
0
    def checkMedia(self):
        # Make sure the media is mounted before the user leaves the machine
        # unattended for the actual install.
        media.runtimeActionMountMedia()

        self.setSubstepEnv( {'next': self.stepForward } )
Esempio n. 7
0
    def checkMedia(self):
        # Make sure the media is mounted before the user leaves the machine
        # unattended for the actual install.
        media.runtimeActionMountMedia()

        self.setSubstepEnv({'next': self.stepForward})