def test_hashes_and_files(self): h = ArchiveUrlFetchHandler() for deb, sha in DEBS.iteritems(): try: h.download_and_validate(full_url(deb), sha, validate="sha1") except Exception as e: self.fail("download and validate failed: " + str(e))
def download_from_upstream(): if not config('fallback_url') or not config('fallback_sum'): status_set('blocked', 'Missing configuration: ') return None client = ArchiveUrlFetchHandler() return client.download_and_validate(config('fallback_url'), config('fallback_sum'))
def install(): h = ArchiveUrlFetchHandler() # download, validate, install for deb, sha in DEBS.iteritems(): install_deb(h.download_and_validate(full_url(deb), sha, validate="sha1"))