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
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 []
def getNext(self): # Make sure the media is mounted before the user leaves the machine # unattended for the actual install. media.runtimeActionMountMedia()
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 } )
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})