summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Imported Translations from Transifex1.0.00.3.0OpenStack Proposal Bot2014-09-075-0/+142
| | | | Change-Id: Id201fa12f241bfe8693ee3307f9fc8f5ccd441e3
* Remove unused dependency on oslo.configDoug Hellmann2014-09-031-1/+0
| | | | | | | Nothing in oslo.utils imports oslo.config, so don't list it as a requirement for installation. Change-Id: I16e68df8b01ac84bb08227b2bd3d8a81dcf34d76
* Merge "Just use int(BOOL) to convert to 1 or 0"Jenkins2014-09-031-1/+1
|\
| * Just use int(BOOL) to convert to 1 or 0Angus Lees2014-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | (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
* | Updated from global requirementsOpenStack Proposal Bot2014-08-303-7/+15
|/ | | | Change-Id: I41e63a06f85e17afa99f07df06ed2848032d449f
* Re-enable _import* hidden methods in import_utilsDavanum Srinivas2014-08-262-36/+36
| | | | | | | | | 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 strutils.mask_password more secure0.2.0Davanum Srinivas2014-08-152-13/+74
| | | | | | | | | | | | | | | | | | | | | | | 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
* New public API for mask_password ported from incubatorDavanum Srinivas2014-08-152-0/+298
| | | | | | | | | 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
* Imported Translations from TransifexOpenStack Proposal Bot2014-08-115-35/+103
| | | | Change-Id: Id7f35b15951c5b6a42f4c58c216210182e55ccc7
* Merge "Make return type from urlsplit private"0.1.10.1.0Jenkins2014-07-281-3/+3
|\
| * Make return type from urlsplit privateDoug Hellmann2014-07-231-3/+3
| | | | | | | | | | | | | | | | | | 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
* | Merge "Add API docs and clean up other docs"Jenkins2014-07-2516-9/+76
|\ \
| * | Add API docs and clean up other docsDoug Hellmann2014-07-2316-9/+76
| |/ | | | | | | | | | | | | Add auto-generated documentation for the public modules in the library and clean up a bit of the docstrings used. Change-Id: Id5efa5c413b82e13f1a7ac78c92e39c193f12214
* | Make the i18n integration module privateDoug Hellmann2014-07-234-3/+3
|/ | | | | | | | 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
* Merge "Cleaning up index.rst file"Jenkins2014-07-221-6/+1
|\
| * Cleaning up index.rst fileChristian Berendt2014-07-211-6/+1
| | | | | | | | | | | | Removed notes about the generation of the file. Change-Id: I06355eb96cbd0fb564b7e7dbe3c10adecad74a1d
* | Merge "export only try_import in __all__"Jenkins2014-07-222-36/+36
|\ \
| * | export only try_import in __all__Davanum Srinivas2014-07-182-36/+36
| |/ | | | | | | | | bp graduate-oslo-utils Change-Id: I63533746d0f4a45aa9f21d235c0353300c8af4cb
* | Merge "Setup for translation"Jenkins2014-07-221-0/+64
|\ \ | |/ |/|
| * Setup for translationAndreas Jaeger2014-07-151-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Switch to oslo.i18n and remove any dependency on oslo-incubatorDavanum Srinivas2014-07-159-520/+41
| | | | | | | | | | bp graduate-oslo-utils Change-Id: Ibe545beafa03c18c3e1228ed2f36c8f3c89ba181
* | Move units into oslo.utilsDavanum Srinivas2014-07-153-4/+3
| | | | | | | | | | bp graduate-oslo-utils Change-Id: I022dd51c9c9a59462ad94380c6ea7fbc0d145613
* | Switch to standard python loggingDavanum Srinivas2014-07-158-1484/+1
| | | | | | | | | | bp graduate-oslo-utils Change-Id: I9429800e6e60f2ccd0debc169738e75d97918d25
* | Split strutils into 2 different modulesFlavio Percoco2014-07-114-115/+157
|/ | | | | | | | | | 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
* Merge pull request #1 from FlaPer87/masterDavanum Srinivas2014-07-032-17/+17
|\ | | | | Rename network_utils into netutils
| * Rename network_utils into netutilsFlavio Percoco2014-07-032-17/+17
|/ | | | | Based on the latest version of the spec, this module should be renamed into netutils.
* get pep8 workingDavanum Srinivas2014-06-181-1/+1
|
* Get the tox tests workingDavanum Srinivas2014-06-1831-47/+2241
|
* exported from oslo-incubator by graduate.shDavanum Srinivas2014-06-1832-0/+625
|
* Fixed a new pep8 error and a small typoAlex Gaynor2014-06-101-1/+1
| | | | Change-Id: I03416abe1c2207265ddd50d49b77a90e4cf5c48b
* Set pbr 'warnerrors' option for doc buildIldiko2014-06-061-2/+1
| | | | | | | | 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
* fixed typos found by RETF rulesChristian Berendt2014-05-031-1/+1
| | | | | | rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos Change-Id: I64d4c236a3741d50f46cad3e6646ef93f739be7b
* Use moxstubout and mockpatch from oslotestVictor Sergeyev2014-04-151-1/+1
| | | | | | | | | | 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
* Remove ValueError when accessing sys.modulesJakub Libosvar2014-04-031-2/+2
| | | | | | | | | | | | | 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
* Enable configuring tcp keepalivepran19902014-04-282-0/+80
| | | | | | | | | | | 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
* Avoid raising index error when no hostJoshua Harlow2014-04-112-1/+12
| | | | | | | | | | 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
* Remove str() from LOG.* and exceptionsJay S. Bryant2014-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Remove import workaround of SplitResultChangBo Guo(gcb)2014-04-211-11/+1
| | | | | | | six 1.6.0 includes fix for SplitResult, we can remove the workaround now. Change-Id: I79aa154bac7e23e18ac63190f031cc937573e8ee
* Use oslotest instead of common test moduleVictor Sergeyev2014-04-155-13/+15
| | | | | | | | 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
* Partial fix of test_strutils.py on Python 3Victor Stinner2014-04-071-7/+10
| | | | | | | | | | | 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
* Fix safe_encode(): return bytes on Python 3Victor Stinner2014-04-072-20/+17
| | | | | | | | | | 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 issues with IPv6 addresses in python26Davanum Srinivas2014-03-262-1/+56
| | | | | | | | | | | | | 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
* save_and_reraise_exception: make logging respect the reraise parameterOleg Bondarev2014-03-132-14/+48
| | | | | | | | | Do not log original exception if reraise is set to False Closes-Bug: #1291850 Related-Bug: #1288188 Change-Id: Icd5fcba25c2cd549cee70353a7a62d83bfe1255b
* strutils: Allow safe_{encode,decode} to take bytes as inputCyril Roelandt2014-03-042-4/+8
| | | | | | | In Python 3, passing "b'foo'" to safe_{encode,decode} currently fails. This patch fixes this issue. Change-Id: I01a5312700be80f353725fdf13de6413c4eb86f3
* Fix import order in test_excutilsBrant Knudson2014-02-211-2/+3
| | | | | | | | | | | | 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 oslo log messages with translation domainsDoug Hellmann2014-01-081-4/+4
| | | | | | | | | | | | | 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
* Implements SI/IEC unit system conversion to bytesZhongyue Luo2013-09-022-61/+159
| | | | | | | | | | | | | | | | | | | | | | 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
* Add basic Python 3 testsJulien Danjou2013-06-121-1/+1
| | | | | | | | | | | | 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>
* py3kcompat: removeJulien Danjou2014-02-061-3/+13
| | | | | | | 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
* Deleted duplicated method in cliutils.ekudryashova2014-01-211-0/+7
| | | | | | | | | | 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