summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | Tests to cover various mailmap formats.Bhuvan Arumugam2012-05-121-6/+30
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 994957 Mailmap might include entries in different format: Full Name <email@foo.com> Full Name <email@bar.com> Firstname <email@foo.com> Firstname <email@bar.com> <email@foo.com> <email@bar.com> This commit adds a test case to parse these entries. * tests/unit/test_setup.py Remove unused imports. Import os and setup methods to verify. SetupTest: Define unique test case name. setUp(): New method to define temporary mailmap file. tearDown(): New method to remove the temporary mailmap file. test_mailmap_with_fullname(): New method to test mailmap entry with fullname. test_mailmap_with_firstname(): New method to test mailmap entry with first name only. test_mailmap_with_noname(): New method to test mailmap entry with just email addresses. Change-Id: Icc018d4b2692ce7a7de757f02d1dd49241c30a6c
* Merge "cfg: automatically create option groups"Jenkins2012-05-102-9/+29
|\
| * cfg: automatically create option groupsMark McLoughlin2012-05-102-9/+29
| | | | | | | | | | | | | | | | | | | | Implements blueprint cfg-auto-create-groups Remove the restriction that groups must be explicitly created. Often you only need a group to have a name (not e.g. a title or help string) so we can easily just auto-create groups for that case. Change-Id: I150ab3900e3aad0068b93487c8d396d21d26cfea
* | Merge "cfg: allow options to be marked as required"Jenkins2012-05-102-2/+140
|\ \
| * | cfg: allow options to be marked as requiredMark McLoughlin2012-05-102-2/+140
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Implements blueprint cfg-required-options Add a 'required' flag to option schemas: StrOpt('foo', required=True) which causes a RequiredOptError exception to be raised if the user fails to supply a value for the option on the CLI or in a config file. Change-Id: Ied7bb25f0c1582c4991d0f212f4871b9358b73fb
* / cfg: use a list comprehension instead of map()Mark McLoughlin2012-05-101-1/+1
|/ | | | Change-Id: Iaccb71d83d957aae77fa0f6bc71952b899d3a159
* Encapsulate common sdist actions into a cmdclass.Monty Taylor2012-05-061-0/+37
| | | | | | | | | | | | The pattern of running generate_authors and write_git_changelog at sdist time is (and should be) repeated in all project's setup.py. Instead of copying the creation of the two classes and injection of them into a cmdclass dict, we can do it here and have it be consistent. Related to bug 986462. Change-Id: I0b7b44d58685551482f874b2a6091dec29e6bed6
* Truly handle mailmap entries for all combinations.Bhuvan Arumugam2012-05-041-1/+2
| | | | | | | | | | | | | | | | | | Bug: 994957 Mailmap might contain mapping with full name. This commit fixes it to handle these combinations: Foo ZZ <email@foo.com> Bar YY <email@bar.com> Foo <email@foo.com> Bar <email@bar.com> <email@foo.com> <email@bar.com> This is inline with mailmap convention described here: http://man.github.com/git/git-shortlog.html * openstack/common/setup.py parse_mailmap(): Pull out canonical and alias email addresses. Change-Id: Iabe9612efecbd18f7a5b0725de7d2515ab24125d
* Merge "Add save_and_reraise_exception()."Jenkins2012-05-022-0/+99
|\
| * Add save_and_reraise_exception().Russell Bryant2012-05-022-0/+99
| | | | | | | | | | | | | | | | | | This patch adds save_and_reraise_exception() to a new module, openstack.common.excutils. This is based on the function of the same name from nova.utils. It is used by nova.rpc, so something equivalent is needed in openstack-common before nova.rpc can be moved here. Change-Id: Icec574a081837e0f2d0548a5759d21b0352dbee6
* | Merge "Remove common.exception from common.importutils."Jenkins2012-05-022-5/+2
|\ \
| * | Remove common.exception from common.importutils.Russell Bryant2012-05-022-5/+2
| |/ | | | | | | | | | | | | | | This patch removes the usage of common.exception from common.importutils. Instead of raising exception.NotFound() from importutils.import_class(), just use the built-in ImportError. Change-Id: I95e84908d1f80c5ca3bbac049eda8faa64212ae0
* | Merge "New ConfigOpts.find_file() for locating conf files"Jenkins2012-05-022-21/+122
|\ \ | |/ |/|
| * New ConfigOpts.find_file() for locating conf filesMark McLoughlin2012-05-012-21/+122
| | | | | | | | | | | | | | | | | | | | | | Most services have the need to locate files like api-paste.ini or policy.json. This new method attempts to find these files by looking alongside the config files already parsed by ConfigOpts and, failing that, falls back to a standard set of directories. Change-Id: I95897816485b88f78854df194cab7872d7c5452a
* | Merge "Support for directory source of config files"Jenkins2012-05-012-56/+157
|\|
| * Support for directory source of config filesEoghan Glynn2012-04-302-56/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements bp cfg-config-dir Allow multiple config files to be pulled in from a config directory, as opposed to individual config files being explicitly enumerated. This logic is enabled using the --config-dir=/path/to/config CLI option, causing config to be retrived from all matching /path/to/config/*.conf files. Sections may be re-opened across config files, and all config items must reside in an explicitly specified section (i.e. it does not default to [DEFAULT]). This behavior is unchanged. Change-Id: Ia29dffe82dfb4742dcf3e8d36b376d906a2492cf
* | Merge "Update exception from importutils.import_class()."Jenkins2012-04-301-2/+3
|\ \
| * | Update exception from importutils.import_class().Russell Bryant2012-04-281-2/+3
| |/ | | | | | | | | | | | | | | | | | | Update the message included in the exception from importutils.import_class() to include what the inner exception was. This is quite helpful as the real error may not have been that the class was not found. It may have failed to import the module that contains that class, and it's nice to know that and why that happened. Change-Id: I085864d230b46adce8921e362f058f9421a5a674
* / Handle authors existed before VCS was around.Bhuvan Arumugam2012-04-301-7/+12
|/ | | | | | | | | | | | | | Bug: 976267 The list of such authors are stored in AUTHORS.in file. When auto generating AUTHORS file, include them as well. * openstack/common/setup.py __doc__: For all methods, remove space and include period. generate_authors(): If AUTHORS.in file exist, append the content to AUTHORS file. Change-Id: I05da1e561383cc151e7ef34e75a4600e3afdda6e
* Fix ordering in HACKING.rstJoe Gordon2012-04-261-1/+1
| | | | | | | | | | Already fixed in nova. Switched: from nova.endpoint import cloud import nova.flags Change-Id: I5d4f64d0710c8bb12031c3960401f6d6d2a67843
* Provide file extension when when looking for filesBrian Waldon2012-04-262-5/+16
| | | | | | * Allow an extension to be passed to find_config files, defaulting to '.conf' Change-Id: I022a3b28d9067158e9ed0da741a5e72cb73af167
* Some refactoring of the cfg cacheMark McLoughlin2012-04-241-34/+12
| | | | | | | | | | | | | | | | | | | A fairly misc bunch of changes: - init cache before registering config-file and just let register_cli_opt() clear the empty cache - use @__clear_cache on set_default() and set_override() since these are just used by the unit tests and doing so allows us to kill _remove_from_cache() - use @__clear_cache on reset() too - remove recursion from _get() and the substitute param - just use (group_name, opt_name) as the cache key Change-Id: I66934e748eca9ec03e44d7f80a7e10d96a77d8eb
* Add caching to openstack.common.cfgYuriy Taraday2012-04-241-7/+60
| | | | | | | Speedup of 'nova list' benchmark by up to 40%, eliminates 3 lines in top-10 cProfile methods. Change-Id: I2d4636f94d88b4a7e38d1565fdd4d1b8a89e560e
* Add AUTHORS generation function.Bhuvan Arumugam2012-04-121-1/+14
| | | | Change-Id: I0adbf0755a0191c7b68af9ca2f6e50c787ee7043
* Change behavior in utils.import_object().Russell Bryant2012-04-116-43/+98
| | | | | | | | | | | | | | | | | | | 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-114-30/+73
| | | | | | | This patch moves auth_str_utils() to a new module, authutils, for helper functions related to authentication. Change-Id: I83f174486269701deed3500f890832a71ff3e315
* Merge "Create openstack.common.timeutils."Jenkins2012-04-114-180/+230
|\
| * Create openstack.common.timeutils.Russell Bryant2012-04-044-180/+230
| | | | | | | | | | | | | | Split time related utility functions out of openstack.common.utils into a new module, timeutils. Change-Id: Ic09952cd48e0b4548e410926cc456cbd515a4e56
* | Merge "Add generic PasteDeploy app and filter factories"Jenkins2012-04-042-0/+273
|\ \ | |/ |/|
| * Add generic PasteDeploy app and filter factoriesMark McLoughlin2012-03-262-0/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These generic factories allow us to dump copied and pasted app_factory and filter_factory methods. The main difference is the paste configuration changes from: [app:myapp] paste.app_factory = myapp:app_factory ... [filter:myfilter] paste.filter_factory = myapp:filter_factory to this: [app:myapp] paste.app_factory = openstack.common.pastedeploy:app_factory openstack.app_factory = myapp:App ... [filter:myfilter] paste.filter_factory = openstack.common.pastedeploy:filter_factory openstack.filter_factory = myapp:Filter Apart from reducing code duplication, this will also allow us to have the generic factories inject other data into the apps and filters. This could implemented as a new feature in PasteDeploy itself - e.g. allow the loadapp() caller supply a python object which is passed on to the factories. In the meantime, Glance has code like this to pass a ConfigOpts instance to factories. Keystone is moving a similar way, as will other projects as they move away from a global config object. Change-Id: I928d1f6da154f0f41edd624e25b8918a0e12cb28
* | Merge "Add greenthread local storage model from nova"Jenkins2012-04-042-0/+90
|\|
| * Add greenthread local storage model from novaMark McLoughlin2012-03-162-0/+90
| | | | | | | | | | | | | | | | | | | | | | Thread local storage is obviously a very useful facility to have available. Nova has a very simple API for this which uses eventlet's corolocal module and weakrefs. This looks to be generally useful and complete, so let's pull it into openstack-common. Change-Id: I52a08124297c9cb79def447436859bd8d2c0b622
* | Merge "Make 'yes' also a true boolean"Jenkins2012-03-302-4/+13
|\ \
| * | Make 'yes' also a true booleanSean Dague2012-03-222-4/+13
| | | | | | | | | | | | | | | | | | | | | Adds yes, Yes, and all other capitalizations as a true boolean. Updated unit tests to test for these. Change-Id: I97915f870dd6bba612f74f0ceb78f2399fd81a93
* | | Typofix, OptionGroup should be OptGroup.Rick Harris2012-03-291-2/+2
| | | | | | | | | | | | Change-Id: I67473bb847759ce719876e08f8a894e000f11bb3
* | | Create openstack/common/__init__.pyRick Harris2012-03-281-5/+16
| | | | | | | | | | | | | | | | | | Fixes bug 967808 Change-Id: Ic4c1fc5520cb96f40b6ed87bfff024906f983235
* | | Use absolute import for iniparser.Rick Harris2012-03-281-1/+1
|/ / | | | | | | | | | | Fixes bug 967400 Change-Id: I0c028f6b5285cd641dedbcea3132224e404b004e
* | Added a universal style-guide for all OS projects.Andrew Bogott2012-03-221-0/+257
| | | | | | | | | | | | | | | | Pursuant to a recent mailing list discussion, this file contains the union of all style recommendations from varions openstack projects. The file will be removed from individual projects. Change-Id: I79c118ff749d7c89d7d88302279ec8cb1530868d
* | Merge "Finish implementing MultiStrOpt"Jenkins2012-03-224-34/+359
|\ \
| * | Finish implementing MultiStrOptJohannes Erdfelt2012-03-224-34/+359
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug 955308 Previously only multiple string options from the CLI were supported. This change adds support for config files too and merges the results from both CLI and config files. Change-Id: I642408c03ed295fac050105fd4380940e876f228
* | | Merge "Avoid leaking secrets into config logging."Jenkins2012-03-222-7/+32
|\ \ \ | |/ / |/| |
| * | Avoid leaking secrets into config logging.Eoghan Glynn2012-03-222-7/+32
| |/ | | | | | | | | | | | | | | | | Implements bp cfg-password-options Allow options to be declared secret so that their value is obfuscated before logging. Change-Id: Ie2168d218b029d9c12fa5b48342cd5b17b2cc77a
* / Add auth_str_equal() to common utils.Russell Bryant2012-03-192-0/+30
|/ | | | | | | | | | | 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
* Merge "Fix bug 954488"Jenkins2012-03-141-1/+1
|\
| * Fix bug 954488Joe Gordon2012-03-131-1/+1
| | | | | | | | Change-Id: I99b764310c575e70aff4a6790e8ba8f55e43deeb
* | Import cfg module directly if not in pathJason Kölker2012-03-091-4/+27
|/ | | | | | | | | | | | | If openstack.common is not installed, but another module has declared the openstack namespace an ImportError is thrown since the common doesnt exist in the openstack namespace. This falls back to importing cfg directly from ./openstack/common/cfg.py. Also ensures that openstack/__init__.py exists in the destination * Fixes LP951197 Change-Id: I88c26fb7cc1aed97e66b068e4f0562b1f00b2b29
* 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-222-0/+14
| | | | | | Keystone uses this optparse method. Change-Id: Ic840b2fb2234a12cd94ca671a8d90cd2affe3a5e
* Promote more complete support for ISO 8601 time.Eoghan Glynn2012-02-203-5/+131
| | | | | | | | | | | | | | | 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