[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 08/24] tests/functional: add a module for handling asset d
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v3 08/24] tests/functional: add a module for handling asset download & caching |
Date: |
Fri, 2 Aug 2024 09:32:20 +0100 |
User-agent: |
Mutt/2.2.12 (2023-09-09) |
On Fri, Aug 02, 2024 at 07:51:14AM +1000, Richard Henderson wrote:
> On 7/31/24 03:03, Daniel P. Berrangé wrote:
> > + def __init__(self, url, hash):
> > + self.url = url
> > + self.hash = hash
> > + self.cache_dir = Path(Path("~").expanduser(),
> > + ".cache", "qemu", "download")
> > + self.cache_file = Path(self.cache_dir,
> > +
> > hashlib.sha256(url.encode("utf-8")).hexdigest())
>
> Out of curiosity, why are we hashing the url from which we downloaded?
> Why not use the known hash of the contents?
>
> If a url goes stale, and we adjust the url to a new host, we shouldn't need
> to re-download just because the url changed.
Hmmm, good point, will change it.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|