System-level utilities and helper functions.
Bases: object
An eventlet thread friendly class for reading in image data.
When accessing data either through the iterator or the read method we perform a sleep to allow a co-operative yield. When there is more than one image being uploaded/downloaded this prevents eventlet thread starvation, ie allows all threads to be scheduled periodically rather than having the same thread be continuously active.
Return the next chunk of the underlying iterator.
This is replaced with cooperative_read in __init__ if the underlying fd already supports read().
Return an iterator to a file-like obj which yields fixed size chunks
fp – a file-like object
chunk_size – maximum size of chunk
Wrap a readable iterator with a reader yielding chunks of a preferred size, otherwise leave iterator unchanged.
iter – an iter which may also be readable
chunk_size – maximum size of chunk
Return an iterator which schedules after each iteration. This can prevent eventlet thread starvation.
iter – an iterator to wrap
Wrap a file descriptor’s read with a partial function which schedules after each read. This can prevent eventlet thread starvation.
fd – a file descriptor to wrap
Returns the required hasher, given the hashing algorithm. This is primarily to ensure that the hash algorithm is correctly chosen when executed on a FIPS enabled system
hash_algo – hash algorithm requested
usedforsecurity – whether the hashes are used in a security context
Returns validation of a value as a UUID.
For our purposes, a UUID is a canonical form string: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.