Updated: [rhinstaller/blivet/pulls/251 master] Use libbytesize's Size class as a base for our Size class

vpodzime installerbot-noreply at redhat.com
Fri Oct 23 11:45:56 UTC 2015


libbytesize provides an implementation of what we need for manipulations and
calculations with sizes in bytes. It's a little bit faster and more importantly
it can be shared with other projects because it's written in C. Thus we should
use it.

At some point it would be nice if we could drop our own Size class and the
blivet/size.py module altogether because they don't bring any extra value, but
for now we need this thin wrapper to keep the API (almost*) stable. The only
real changes are:

1) Strings like "100 kibibytes" are no longer accepted, I doubt anybody has ever
used this functionality. If the opposite turns out to be true such support will
be added to libbytesize and no change will be needed in Blivet.

2) humanReadable() now ignores the 'skip' and 'min_value' attributes. The former
one is always replaced by 'True' (i.e. trailing zeroes are always stripped), the
latter one is ignored because it made things really cryptic and weird.

* see the commit, mainly the part modifying/removing the tests for more details

Note: tests are expected to be failing at this phase -- libbytesize is not available as a package yet. I am of course not going to merge this before that changes.
-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/251


More information about the anaconda-patches mailing list