| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: Id201fa12f241bfe8693ee3307f9fc8f5ccd441e3
|
|
|
|
|
|
|
| |
Nothing in oslo.utils imports oslo.config, so don't list it as a
requirement for installation.
Change-Id: I16e68df8b01ac84bb08227b2bd3d8a81dcf34d76
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(This is split out from I24461f4328e188c8983ad574495e11e033ec5ba4 on
neutron, which was a hunt to remove "PRED and A or B" deprecated ternary
idiom.)
int(bool) already returns only 1 or 0 - no need to do our own explicit
version.
Change-Id: Ib482d6cb63ece7e1d5073fa7dc1c7daf9db8a0b3
|
|/
|
|
| |
Change-Id: I41e63a06f85e17afa99f07df06ed2848032d449f
|
|
|
|
|
|
|
|
|
| |
There are many scenarios in different projects that end
up needing this support. We should gently nudge everyone
to move to Stevedore but can't mandate it by hiding
these methods.
Change-Id: Ie2783fabf52491a490c999728995da8e68e62cd8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make some enhancements to strutils.mask_password to allow it to catch
more cases of passwords in strings. Test cases have been added to test
for these newly added situations.
The following is a listing of patterns that will be handled. The
keyword that mask_password uses (a list of four now) is represented by
<key> and the password is shown as <password>. Quotes (both single and
double) are represented as <quote>.
--<key> <password>
--<key> <quote><password><quote>
<key> = <password>
<key> = <quote><password><quote>
All existing tests and patterns are still handled.
Originally submitted in If5ea2d91b1d87c995f50d07a1281879493bd7adb
Change-Id: Ifa9a753821484defb5784b136470e3a78ebed3e3
Partial-Bug: #1345233
|
|
|
|
|
|
|
|
|
| |
mask_password is used in processutils and log modules. processutils
is going into oslo.concurrency and log into oslo.log. Since we don't
want any oslo library to depend on oslo.log, we need this facility
in oslo.utils for use by both oslo.log and oslo.concurrency.
Change-Id: I7d3cda719908413cea074935eb6c4e94cb6071d3
|
|
|
|
| |
Change-Id: Id7f35b15951c5b6a42f4c58c216210182e55ccc7
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The ModifiedSplitResult class should be private because when we drop
python 2.6 support we can replace the urlsplit() wrapper we have with a
reference to the one in the python standard library, which returns a
different type.
Change-Id: I413de125c58ee54a0aaaf608f57283e76283bf84
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| | |
Add auto-generated documentation for the public modules in the library
and clean up a bit of the docstrings used.
Change-Id: Id5efa5c413b82e13f1a7ac78c92e39c193f12214
|
|/
|
|
|
|
|
|
| |
Rename oslo.utils.i18n to oslo.utils._i18n to highlight the fact that it
is an implementation detail and should not be imported and used by
consumers of oslo.utils.
Change-Id: Ib271f7e1216e3c865929d39749a9fb96237ad4f2
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Removed notes about the generation of the file.
Change-Id: I06355eb96cbd0fb564b7e7dbe3c10adecad74a1d
|
|\ \ |
|
| |/
| |
| |
| |
| | |
bp graduate-oslo-utils
Change-Id: I63533746d0f4a45aa9f21d235c0353300c8af4cb
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To start translation, we need to initially import the
translation file - and place it at the proper place so that
the usual CI scripts can handle it.
The proper place is for all python projects
$PROJECT/locale/$PROJECT.pot - see setup.cfg.
Further imports will be done by the OpenStack Proposal bot.
bp graduate-oslo.utils
Change-Id: I270753ebd205e86a4a04225f74d6d40f4253e21c
|
| |
| |
| |
| |
| | |
bp graduate-oslo-utils
Change-Id: Ibe545beafa03c18c3e1228ed2f36c8f3c89ba181
|
| |
| |
| |
| |
| | |
bp graduate-oslo-utils
Change-Id: I022dd51c9c9a59462ad94380c6ea7fbc0d145613
|
| |
| |
| |
| |
| | |
bp graduate-oslo-utils
Change-Id: I9429800e6e60f2ccd0debc169738e75d97918d25
|
|/
|
|
|
|
|
|
|
|
| |
This patch pulls encoding related functions out of strutils into its own
encodeutils module. We could probably find a better name for strutils
now, although it seems short and contextualized enough.
Partially-implements blueprint: graduate-oslo-utils
Change-Id: Ib76065823c8a1b56020f14cea80b6d73e150aa49
|
|\
| |
| | |
Rename network_utils into netutils
|
|/
|
|
|
| |
Based on the latest version of the spec, this module should be renamed
into netutils.
|
| |
|
| |
|
| |
|
|
|
|
| |
Change-Id: I03416abe1c2207265ddd50d49b77a90e4cf5c48b
|
|
|
|
|
|
|
|
| |
By setting this pbr option in setup.cfg, the doc build will fail in case
of any warnings or errors occur during the build process. To be able to
turn on this setting, the current formatting errors were fixed.
Change-Id: Iec3f70eeb56c4652c2171e5f58c433f1434e6be1
|
|
|
|
|
|
| |
rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos
Change-Id: I64d4c236a3741d50f46cad3e6646ef93f739be7b
|
|
|
|
|
|
|
|
|
|
| |
Modules moxstubout and mockpatch from openstack/common/fixture/
are obsolete, so we should use them from oslotest library.
Also oslotest depends on mock and mox, so we no longer need
to specify them directly in test-requirements files
Change-Id: I139133457cd73ee83537dead3446ee30d0ee5589
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously there was ValueError that cannot be raised either by
__import__() nor getattr(). I think the original idea was to have KeyError
in order to catch exception when module is not part of sys.modules.
Since there is __import__ prior to getting class from sys.modules, there
is eliminated a chance of raising KeyError when getting key from
sys.modules. Either __import__ raises exception or import is successful
and module is present in sys.modules.
Change-Id: I1344a9e9d544b0c48e36f96be5b01911a7ec5497
|
|
|
|
|
|
|
|
|
|
|
| |
Added a function set_tcp_keepalive in network_utils.py to set configuration of
tcp keepalive parameters. Projects can call this function and set values in
them, if needed.
Also added unittests to test this function.
Implements blueprint configure-tcp-keepalive
Change-Id: I8b978a604f29953911c2fe4bad74e28e5ba74c35
|
|
|
|
|
|
|
|
|
|
| |
Strings like 'http://' are not correctly parsing
due to an index error raised when the first element
of the address is parsed (which is empty). Avoid this
by first checking if the address is non-empty before
doing work on it.
Change-Id: Ic50c9b31083dea82d068423f6809ec13c85da00a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gettextutils is expecting to receive unicode strings
rather than basestrings. A basestring can cause an
unhandled exception in the logging code. To help avoid
such issues we should remove str() from LOG.* messages and
exceptions. We have verified that the %s formatting code
properly handle getting strings to unicode where necessary.
This patch also fixes one case where a message object was
being concatenated with '+' . This, like using str() will
cause logging to fail and needs to be fixed.
See bug https://bugs.launchpad.net/cinder/+bug/1274245 for
the original discussion of this problem.
Fix for oslo.messaging: https://review.openstack.org/90577
Change-Id: Iad7c2284c6b21322b96dc881a82bbbab4ebb208e
Closes-bug: 1286306
|
|
|
|
|
|
|
| |
six 1.6.0 includes fix for SplitResult, we can remove the
workaround now.
Change-Id: I79aa154bac7e23e18ac63190f031cc937573e8ee
|
|
|
|
|
|
|
|
| |
Module openstack.common.test is obsolete, so we should use
oslotest library instead of it.
Modified tests and common database code, new requirement added.
Change-Id: I853e548f11a4c3785eaf75124510a6d789536634
|
|
|
|
|
|
|
|
|
|
|
| |
StringToBytesTest does not work on Python 3 because it uses testscenarios which
does not work in nosetests, see the bug:
https://bugs.launchpad.net/testscenarios/+bug/872887
Because of this bug, the test_strutils.py is not enabled yet for py33 in
tox.ini.
Change-Id: Ie3a7742dfd802f21c6c7420e3b894122e1dca295
|
|
|
|
|
|
|
|
|
|
| |
safe_decode() decodes bytes to text. safe_encode() should be the reverse
operation: encode text to bytes. Currently, it returns text on Python 3
which is wrong in my opinion.
The patch fixes also test_encode() on Python 3.
Change-Id: If91a866d864a22d28a352152beff4c7406a27b7b
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
urlsplit can't handle RFC 2732 URLs. reuse the
parse_host_port to rectify the hostname and
port implementation of SplitResult. Added test
cases to make sure we get the right ip and port
when the urls have ipv6 in them. Added an additional
test for both ipv4 and ipv6 to ensure we are indeed
handling username password in urls as well
Change-Id: I054f5e46cc8c201aaa48ee2d8b9d0a09b30a48ce
Closes-Bug: #1298137
|
|
|
|
|
|
|
|
|
| |
Do not log original exception if reraise is set to False
Closes-Bug: #1291850
Related-Bug: #1288188
Change-Id: Icd5fcba25c2cd549cee70353a7a62d83bfe1255b
|
|
|
|
|
|
|
| |
In Python 3, passing "b'foo'" to safe_{encode,decode} currently fails. This
patch fixes this issue.
Change-Id: I01a5312700be80f353725fdf13de6413c4eb86f3
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tests.unit.test_excutils module would fail to import by
itself because it couldn't import the mox modules from six.moves.
This is because the mox module is registered with six.moves in
openstack.common's __init__ and that hadn't been imported yet.
The fix is to use mox from moxstubout since that part imported
mox already.
Change-Id: I786b9bffba28935f59da0dcf84ef2b5aa3f2b58d
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update the incubator code to use different domains for log
messages at different levels.
Update the import exceptions setting for hacking to allow
multiple functions to be imported from gettextutils on one
line.
bp log-messages-translation-domain
Change-Id: I6ce0f4a59438612ce74c46b3ee9398bef24c0c19
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issues with utils.to_bytes are
1) Ignores measure of unit and treats b and B both as Byte
2) Cannot handle SI unit system which base is 1000 (IEC=1024)
3) The name "to_bytes" didn't do a good job representing what the function does.
Disscussed here,
https://review.openstack.org/#/c/32093/2/openstack/common/strutils.py
This patch implements "string_to_bytes". The name comes from
"string_to_bool" in cinder/utils.py. Its merits are,
1) Handles bit and byte units
2) Handles SI and IEC unit systems
3) Has a much more intuitive function name
Closes-bug: #1189635
Closes-bug: #1193765
Change-Id: I5f1ce56f447179d1ef6ded7c956983151f5a8f18
|
|
|
|
|
|
|
|
|
|
|
|
| |
This uses `nose' to load and run tests for the time being, as
testrepository tries to load everything, which is not possible
currently. Until everything is Python 3 compatible, using `nose' will be
simpler to list the specific files we want to run.
Blueprint: make-python3-compatible
Change-Id: I4c8dbf11ac8c6e0f25bc60a3e880a30bf87a60bd
Signed-off-by: Julien Danjou <julien@danjou.info>
|
|
|
|
|
|
|
| |
Everything is already in six>=1.4.0 and we already depend on such a
version. There's no reason to keep this file.
Change-Id: I06b90f789ae21f2ef8b8071b4298bfc0406482a6
|
|
|
|
|
|
|
|
|
|
| |
Method import_class in cliutils duplicates method in importutils module,
and method import_versioned_module is more related to import tools,
so it is moved in appropriate module.
bp common-client-library-2
Change-Id: I7b8892b2885f8b05a8106300371481209e99749d
|