try: url = self.info.distro.metalink_url metalink = downloader.download(url, self.info.install_dir, web_proxy=self.info.web_proxy) base_url = os.path.dirname(url) except Exception, err: log.error("Cannot download metalink file %s err=%s" % (url, err)) try: url = self.info.distro.metalink_url2 metalink = downloader.download(url, self.info.install_dir, web_proxy=self.info.web_proxy) base_url = os.path.dirname(url) except Exception, err: log.error("Cannot download metalink file2 %s err=%s" % (url, err)) return if not self.check_metalink(metalink, base_url): log.exception("Cannot authenticate the metalink file, it might be corrupt") self.info.distro.metalink = parse_metalink(metalink) def get_prespecified_iso(self, associated_task): if self.info.iso_path \ and os.path.exists(self.info.iso_path): #TBD shall we do md5 check? Doesn't work well with daylies #TBD if a specified ISO cannot be used notify the user log.debug("Trying to use pre-specified ISO %s" % self.info.iso_path) is_valid_iso = associated_task.add_subtask( self.info.distro.is_valid_iso, description = _("Validating %s") % self.info.iso_path) if is_valid_iso(self.info.iso_path, self.info.check_arch): self.info.cd_path = None return self.copy_iso(self.info.iso_path, associated_task) def set_distro_from_arch(self, cd_or_iso_path):
except Exception, err: log.error("Cannot download metalink file %s err=%s" % (url, err)) try: url = self.info.distro.metalink_url2 metalink = downloader.download(url, self.info.install_dir, web_proxy=self.info.web_proxy) base_url = os.path.dirname(url) except Exception, err: log.error("Cannot download metalink file2 %s err=%s" % (url, err)) return if not self.check_metalink(metalink, base_url): log.exception( "Cannot authenticate the metalink file, it might be corrupt") self.info.distro.metalink = parse_metalink(metalink) def get_prespecified_diskimage(self, associated_task): ''' Use a local disk image specificed on the command line ''' if self.info.dimage_path \ and os.path.exists(self.info.dimage_path): #TBD shall we do md5 check? Doesn't work well with daylies #TBD if a specified disk image cannot be used notify the user self.dimage_path = self.info.dimage_path log.debug("Trying to use pre-specified disk image %s" % self.info.dimage_path) is_valid_dimage = associated_task.add_subtask( self.info.distro.is_valid_dimage, description=_("Validating %s") % self.info.dimage_path)
base_url = os.path.dirname(url) except Exception, err: log.error("Cannot download metalink file %s err=%s" % (url, err)) try: url = self.info.distro.metalink_url2 metalink = downloader.download(url, self.info.install_dir, web_proxy=self.info.web_proxy) base_url = os.path.dirname(url) except Exception, err: log.error("Cannot download metalink file2 %s err=%s" % (url, err)) return metalink_filename, metalink_extension = os.path.splitext(metalink) if metalink_extension == '.list': self.info.distro.metalink = parse_metalink( join_path(self.info.data_dir, 'list.metalink')) metalink = metalink_filename + ".iso" self.info.distro.metalink.files[0].name = os.path.basename( metalink) self.info.distro.metalink.files[0].urls[ 0].url = base_url + "/" + self.info.distro.metalink.files[ 0].name + ".torrent" self.info.distro.metalink.files[0].urls[ 1].url = base_url + "/" + self.info.distro.metalink.files[ 0].name if not self.check_metalink(metalink, base_url): log.exception( "Cannot authenticate the metalink file, it might be corrupt") if not self.info.distro.metalink: self.info.distro.metalink = parse_metalink(metalink)