b9739be699ff29826bfa7b2753ca496d68776aaf
Typically the pattern of the following happens:
>>> s = dict()
>>> v = s.get("blah", True)
>>> v = strutils.bool_from_string(v)
In this case we can avoid converting the value of 'v' to a bool
if it was already a boolean (and if it wasn't then the rest of
the code can be ran to attempt to convert it to one). This avoids
needlessly converting things from bool -> string -> bool which
is not really needed in this case.
Change-Id: Id7397e91e754ff2c63b3f112e95aedf82cd31717
oslo.utils
The oslo.utils library provides support for common utility type functions, such as encoding, exception handling, string manipulation, and time handling.
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/oslo.utils
- Source: http://git.openstack.org/cgit/openstack/oslo.utils
- Bugs: http://bugs.launchpad.net/oslo.utils
Description
Languages
Python
100%