Utility for caching master images.
None
Bases: object
Class handling access to cache for master images.
ImageCache.
clean_up
(amount=None)[source]¶Clean up directory with images, keeping cache of the latest images.
Files with link count >1 are never deleted. Protected by global lock, so that no one messes with master images after we get listing and before we actually delete files.
Parameters: | amount – if present, amount of space to reclaim in bytes, cleaning will stop, if this goal was reached, even if it is possible to clean up more files |
---|
ImageCache.
fetch_image
(href, dest_path, ctx=None, force_raw=True)[source]¶Fetch image by given href to the destination path.
Does nothing if destination path exists and is up to date with cache and href contents. Only creates a hard link (dest_path) to cached image if requested image is already in cache and up to date with href contents. Otherwise downloads an image, stores it in cache and creates a hard link (dest_path) to it.
Parameters: |
|
---|
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.