summaryrefslogtreecommitdiffstats
path: root/openstack/common/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Rename utils.py to strutils.pyZhongyue Luo2012-11-301-59/+0
| | | | | | Fixes bug #1083956 Change-Id: I681227e9428778adb7824a1930a33cfa5ffa13a1
* Make project pyflakes clean.Monty Taylor2012-11-281-9/+0
| | | | | | | | | | | | | Added both a tox test-env for pyflakes and fixed the current pyflakes errors. This did actually fix a couple of bugs. The CI team has started using pyflakes on its projects and also has started using oslo for things, so ignoring pyflakes warnings on the oslo code was starting to get old. However, additionally, pyflakes is pretty solid, so we should maybe consider gating on it across the board. (% locals() is the biggest thing that we do that it doesn't like) Change-Id: Iac1ca62db301892b7863711162fcbc74807eb24f
* updating sphinx documentationJoe Heck2012-11-181-0/+4
| | | | | | | | | | * adding openstack theming (copied from keystone project theme) * updating .gitignore to ignore generated API docs * updated formatting in index.rst page * updaed openstack/common/processutils.py to match hacking docstring * updated docstrings to resolve sphinx warnings Change-Id: Ie89afe20eeab1efd2daf440fc65ccdf90f723c51
* Move utils.execute to its own module.Michael Still2012-11-011-76/+0
| | | | | | | Also move the exceptions raised to being local to the executils module. Change-Id: Ibb2445f92840b9ce4b52373b0b09adb3d6a4a897
* Import order clean-upZhongyue Luo2012-10-291-1/+1
| | | | | | Reorder imports by full module path Change-Id: If619b4b50aa052401f7fa65df57b74d4ad1b65a6
* Extracted parse_host_port into network_utils.Eugene Kirpichov2012-09-261-44/+0
| | | | Change-Id: I77bcbf03a18659cfa62e99da9ba2136f8348022b
* Added a method for parsing host:port pairs.Eugene Kirpichov2012-09-111-0/+44
| | | | | | | | | | | | The method works correctly with ipv6. An alternative way would be to use urlparse, but urlparse only works correctly starting with Python 2.7, so to be compatible, we have to reimplement this part. The method will be used for parsing Glance API server addresses, RabbitMQ addresses and perhaps other things. Change-Id: Ie5014891c6abcd80681a370d5dd94cb0406f7f61
* Remove unused importsJoe Gordon2012-07-261-1/+0
| | | | Change-Id: Ia2900e50263950ba40ba86e685640cacaa2137a7
* Fix missing gettextutils in several modules.Eric Windisch2012-07-121-0/+1
| | | | | | Fixes bug 1021453. Change-Id: I05771a588746a0e43fec0078c5c7152dd9d33b9f
* Update common code to support pep 1.3.Gary Kotton2012-06-181-5/+5
| | | | | | bug 1014216 Change-Id: I3f8fa2e11c9d3f3d34fb20f65ce886bb9c94463d
* Change behavior in utils.import_object().Russell Bryant2012-04-111-20/+0
| | | | | | | | | | | | | | | | | | | Fix bug 972859. Prior to this patch, utils.import_object(foo) and utils.import_class(foo) would return the same thing if foo was the path to a class. This patch changes utils.import_object() to return an instance of the class, instead, also allowing you to pass in arguments to the constructor. This patch also removes the odd behavior of import_object() to be able to also import a module. Instead, a new function import_module() has been added. Finally, the three import helpers have been moved to a new module, importutils. Change-Id: Ia2ea64c965692f8c3a29adec332dd93a83980070
* Move auth_str_equal() to a new authutils module.Russell Bryant2012-04-111-24/+0
| | | | | | | This patch moves auth_str_utils() to a new module, authutils, for helper functions related to authentication. Change-Id: I83f174486269701deed3500f890832a71ff3e315
* Create openstack.common.timeutils.Russell Bryant2012-04-041-49/+0
| | | | | | | Split time related utility functions out of openstack.common.utils into a new module, timeutils. Change-Id: Ic09952cd48e0b4548e410926cc456cbd515a4e56
* Make 'yes' also a true booleanSean Dague2012-03-221-2/+2
| | | | | | | Adds yes, Yes, and all other capitalizations as a true boolean. Updated unit tests to test for these. Change-Id: I97915f870dd6bba612f74f0ceb78f2399fd81a93
* Add auth_str_equal() to common utils.Russell Bryant2012-03-191-0/+24
| | | | | | | | | | | This function provides a constant-time string comparison. Its primary use case is for authentication to avoid timing vulnerabilities. Similar functions currently exist in keystone, nova, and swift. The three diverged in slight ways immediately after going in. This version comes from keystone, which I consider the "best" version to promote to openstack-common. Change-Id: I39537a21be8a402e34e526466f6b90188344a35d
* Promote more complete support for ISO 8601 time.Eoghan Glynn2012-02-201-3/+20
| | | | | | | | | | | | | | | Support for ISO 861 time representation is now duplicated in nova: https://github.com/openstack/nova/commit/c30193fbf and in glance: https://github.com/openstack/glance/commit/f8f9f171 Note this patch introduces a new dependency on python-iso8601, which has already been packaged for Fedora, EPEL and Ubuntu/Debian. Change-Id: I87c32effa97d3b7a8d869522b62c0c6fb31bcef8
* PEP8 cleanup (openstack-common)Zhongyue Luo2012-02-111-5/+5
| | | | | | | | | Fixes bug #930625 Remove backslash continuations in openstack-common. Fix type checking taboos. Change-Id: I49ddb9ff5fa5af760dcfccb52cb4793b71e02f19
* Split functions to avoid eventlet import.Monty Taylor2012-02-061-18/+0
| | | | | | | | | | Some of these functions are used in setup.py. In a virtualenv based workflow, python setup.py sdist is called to create a tarball which is then installed into the virtualenv. These functions need to be in a separate file so that they can be imported by setup.py without eventlet needing to be installed. Change-Id: I6f7dc9614895b8c91135c62373b98afe55e1fc7d
* import should not return an instance of the classJason Kölker2011-12-021-2/+1
|
* use isinstance and types.*Jason Kölker2011-12-011-2/+2
|
* port execute and utcnow functions from novaJason Kölker2011-09-281-0/+103
|
* pull parse_mailmap str_dict_replace from novaJason Kölker2011-09-271-0/+19
|
* reog from import mergeJason Kölker2011-09-271-0/+89