Ian Wienand 7a00f832f9 Add a mixed mode parser to string_to_bytes
This proposes a "mixed" parsing type that interprets the IEC-ish "i"
units as power-of-two and the SI-style "non-i" units as power-of-ten.
This is a round-about way of saying it is basically making it the same
as the way GNU parted interprets such strings [1].

While I'd be the first to admit it's a bit ugly, I think it could
serve a role for people who have to interpret such strings for
compatability reasons.  In particuarly within diskimage-builder, we've
accepted these strings for partition creation (being modeled on
parted) and I'd certainly like to not have our own unit parser if we
can help it.

[1] https://www.gnu.org/software/parted/manual/html_node/unit.html

Change-Id: I772bcb6651484d68afabd1965e5db033439c6257
2017-09-13 21:10:39 +10:00
2017-07-28 21:05:39 +00:00
2016-12-20 14:20:50 +11:00
2014-06-18 23:12:10 -04:00
2015-11-16 23:17:37 +08:00
2017-03-03 00:03:24 +00:00
2017-01-09 10:14:48 -08:00

Team and repository tags

image

oslo.utils

Latest Version

Downloads

The oslo.utils library provides support for common utility type functions, such as encoding, exception handling, string manipulation, and time handling.

Description
OpenStack library utils
Readme 8 MiB
Languages
Python 100%