summaryrefslogtreecommitdiffstats
path: root/openstack/common
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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
* Fix bug 954488Joe Gordon2012-03-131-1/+1
| | | | Change-Id: I99b764310c575e70aff4a6790e8ba8f55e43deeb
* fix restructuredtext formatting in docstringsDoug Hellmann2012-03-091-20/+23
| | | | | | | | | | | | blueprint sphinx-doc-cleanup bug 94516 - Correct parameter declarations, list formatting, cross-references, etc. - We don't need "let" in generate_autodoc_index.sh since we aren't doing math. - Change conf.py to not prefix class and function names with full namespace in generated output to save width on the screen. Change-Id: I9adc8681951913fd291d03e7142146e9d46841df
* Add ConfigOpts.print_help()Mark McLoughlin2012-02-221-0/+4
| | | | | | Keystone uses this optparse method. Change-Id: Ic840b2fb2234a12cd94ca671a8d90cd2affe3a5e
* 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
* cfg: fix a small comment typoZhongyue Luo2012-02-201-1/+1
| | | | Change-Id: I2646d7e674ef3d1759558e820f051cc5e7f3b4ae
* Merge changes I71d99f00,Ib91b5af0Jenkins2012-02-201-4/+44
|\ | | | | | | | | | | * changes: Add git changelog method. Add git vcsversion method.
| * Add git changelog method.Monty Taylor2012-02-091-4/+17
| | | | | | | | Change-Id: I71d99f00b2154bf151a1521016118ba6bd088f79
| * Add git vcsversion method.Monty Taylor2012-02-091-0/+27
| | | | | | | | | | | | | | | | Leaving in the branch_nick for now - I think we need to go through the projects using this code and ensure that they aren't going to get screwed before we remove it. Change-Id: Ib91b5af050244f44cd811ca47cb6e2c53ef74ddb
* | cfg: unneeded multiple inheritanceZhongyue Luo2012-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | Fixed bug #927650 In python=<2.6, collections.Mapping inherits from collections.Sized, collections.Iterable, and collections.Container which are also subclasses of object. Change-Id: I6238c683324127abd9fb637748a10b6bdb2961e0
* | PEP8 cleanup (openstack-common)Zhongyue Luo2012-02-113-23/+23
| | | | | | | | | | | | | | | | | | Fixes bug #930625 Remove backslash continuations in openstack-common. Fix type checking taboos. Change-Id: I49ddb9ff5fa5af760dcfccb52cb4793b71e02f19
* | Merge "Disable ConfigParser interpolation (lp#930270)"Jenkins2012-02-101-1/+1
|\ \
| * | Disable ConfigParser interpolation (lp#930270)Mark McLoughlin2012-02-101-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | This breaks e.g. volume_name_template=volume-%08x instance_name_template=instance-%08x and is not part of the API contract anyway. We use $opt based value interpolation. Change-Id: I7ba566ae7c9a77322b52c67c5e1ffbffb760f0fc
* / Backslash continuations (misc.)Zhongyue Luo2012-02-101-25/+20
|/ | | | | | | | | | | Fixes bug #925166 This patch for packages which have few backslash continuations. Follow up patches will be for packages network, scheduler, virt, db/sqlalchemy, tests, and api/openstack. Change-Id: I4200010b47b33fa8b9115b5d379b543200f6668d
* Updated tox config for multi-python testing.Monty Taylor2012-02-061-0/+45
| | | | Change-Id: Ib1f768c6783db0e63cb51dfc767ae5a31a295c76
* Split functions to avoid eventlet import.Monty Taylor2012-02-062-18/+42
| | | | | | | | | | 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
* Implements blueprint separate-nova-volumeapiAnthony Young2012-02-021-4/+4
| | | | | | | | [...] ** Removes flag osapi_extension and replaces with osapi_compute_extension and osapi_volume_extension [...] Change-Id: I4c2e57c3cafd4e1a9e2ff3ce201c8cf28326afcd
* Makes common/cfg.py raise AttributeErrorVishvananda Ishaya2012-02-021-1/+1
| | | | | | | * fixes bug 915039 * includes test Change-Id: I67b886be3b5af3763f52fffe54085975d61d61eb
* PEP8 type comparison cleanuplzyeval2012-02-021-1/+1
| | | | | | | | | | | | | | | | Fixes bug #910295 The None, True, and False values are singletons. All variable *comparisons* to singletons should use 'is' or 'is not'. All variable *evaluations* to boolean should use 'if' or 'if not'. "== None", "== True", "== False", and "!= None" comparisons in sqlalchemy's where(), or_(), filter(), and_(), and select() functions should not be changed. Incorrect comparisons or evaluations in comments were not changed. Change-Id: I087f0883bf115b5fe714ccfda86a794b9b2a87f7
* Add the Mapping interface to cfg.ConfigOptsMark McLoughlin2012-01-271-11/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements blueprint cfg-mapping interface With cfg, option values are accessed via attributes on ConfigOpts objects e.g. conf = ConfigOpts() conf.register_opt(StrOpt('foo')) conf() print conf.foo One use case that isn't easily supported with option values represented this way is iterating over all the registered options. Standard interfaces for listing attributes on an object aren't suitable because they will list more than just the options. For this use case alone, it's worth having ConfigOpts implement the mapping interface. That way we can do e.g. for opt, value in conf.items(): print "Option %s = %s" % (opt, value) It's interesting to compare argparse's approach to this problem - option values are attributes on a Namespace object which has no attributes or methods to pollute the namespace of option names. This is a nice approach, but would mean that we would be passing around both a ConfigOpts object and a Namespace object. That's a bit too much overhead, and the mapping interface provides a usable workaround where there is a conflict. Change-Id: Ic113919a20291048f962999229c76884ebdd5ad8
* Add support to cfg for disabling interspersed argsMark McLoughlin2012-01-231-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements blueprint cfg-disable-interspersed-args Nova currently relies on cfg being implemented with optparse because it uses optparse's disable_interspersed_args() The use case for this is if you do: $> nova-manage --verbose create --project foo --user bar you want invoking ConfigOpts() to return: ['create', '--project', 'foo', '--user', 'bar'] as the "extra" args rather than aborting when it doesn't recognize the --project arg. This is a reasonable use case for cfg to support and it should just have {disable,enable}_interspersed_args() methods. If we ever switch from optparse to argparse, we'll do something like this: parser.add_argument('--verbose') ... parser.add_argument( 'extra_args', nargs=argparse.REMAINDER if disable_interspersed_args else '*') ... ns = parser.parse_args(...) extra_args = ns.extra_args i.e. we will need an 'extra_args' multi-value positional argument in any case and we'll just pass nargs=REMAINDER if we want trailing options to be included in the extra args. Change-Id: I3ecb7dc18230327cf5aaaa7d832224e64aafa40c
* Add new cfg moduleMark McLoughlin2012-01-101-0/+1124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described here: http://wiki.openstack.org/CommonConfigModule The module implements an API for defining configuration options and reading values for those options that a user may have set in a config file or on the command line. The module is successfully in use in both Nova and Glance. Some work remains in Nova to switch from using it under a gflags compatible shim layer, but Glance is using it fully. There doesn't appear to be any blockers to other projects moving over to it fairly easily. Swift would perhaps be the next project to tackle. Just to go through potential future compatibility concerns: - Nova (the scroundrel) hackily uses the private ConfigOpts::_oparser in order to disable interspersed args. This was just for nova-manage and can probably be resolved some other way. In any case, Nova shouldn't switch to openstack-common's cfg API until it removes this hack. - the CommonConfigOpts subclass set of logging related options is perhaps assuming too much about what configuration options should be common across all the projects. However, it seems a fairly sane set and the worst that can happen is that projects avoid using it. - the parameters to the Opt constructor fairly closely mirror optparse, but they're fairly generic and shouldn't prevent us from switching to e.g. argparse - stuff like %prog expansion in the ConfigOpt's usage ctor param is a similar concern, but it's a very minor concern. - find_config_files() search path is perhaps too much policy for openstack-common; however, it is probably as generic as it could be and projects which need a different policy can just not use the function On the whole, I think we're in good shape wrt future compatibility. Change-Id: I279a9db7806d80aff3b9b085b4a9e4fb193662f9
* 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
|
* make fix_path a real function so it can be mock'dJason Kölker2011-12-011-1/+7
|
* remove unused importsJason Kölker2011-12-011-2/+0
|
* Merge commit '99b2c6c202b1ec450e5f7bc1c4080f8c36773376'Jason Kölker2011-11-011-6/+14
|\
| * Rajaram/Vinkesh|Default xmlns for extension serialization can be overriden, ↵Rajaram Mallya2011-09-091-6/+14
| | | | | | | | added default factory for extension middleware
* | merge in upstreamJason Kölker2011-11-014-70/+968
|\|
| * Rajaram/Vinkesh | Copied tests for wsgi from nova. Added default ↵Rajaram Mallya2011-09-083-123/+146
| | | | | | | | content/accept types in Request which can be overridden by projects. Copied tests for XML serialization of Extension Controller's action from nova
| * Rajaram/Vinkesh | Fixed the extension bug where custom collection actions' ↵Rajaram Mallya2011-09-071-15/+33
| | | | | | | | routes in resource extension were not getting registered
| * Vinkesh/Rajaram|Added nova's extension framework into common and tests for itRajaram Mallya2011-09-071-0/+505
| |
| * Rajaram/Vinkesh|Added nova's serializaiton classes into commonRajaram Mallya2011-09-072-67/+419
| |
| * Rajaram|renamed AppBaseException to OpenstackException and ↵Rajaram Mallya2011-08-312-16/+16
| | | | | | | | app_config_dir_name to config_dir as per jaypipes' feedback
| * Rajaram/Vinkesh| restructured wsgi.resource to allow inheriting classes to ↵Rajaram Mallya2011-08-301-9/+16
| | | | | | | | override serialization, deserialization and action execution
| * Rajaram/Vinkesh | Removed references to Glance in codeRajaram Mallya2011-08-253-27/+20
| |
| * Adding syslog supportRick Harris2011-08-111-7/+13
| |
| * Add some more generic middleware, request context, utils, and versioning. ↵Jay Pipes2011-07-264-0/+200
| | | | | | | | Add basic template for server binary
| * Initial skeleton projectJay Pipes2011-07-264-0/+835
|
* 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-278-0/+1041