summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "update deprecated stanza"Jenkins2012-11-221-3/+3
|\ \ | |/ |/|
| * update deprecated stanzaSean Dague2012-11-151-3/+3
| | | | | | | | | | | | | | | | the deprecated stanza from nova had hard coded "Deprecated Config", but is now be used in not config scenarios. Update it to just "Deprecated". Change-Id: Icf86447aea6cd509e4e67fe0be7e9157006410a4
* | Merge "Add support for positional arguments"Jenkins2012-11-161-12/+65
|\ \
| * | Add support for positional argumentsMark McLoughlin2012-11-151-12/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argparse makes it awkward to implement the current cfg API where we simply return the leftover arguments to the caller. Very few cfg users actually rely on this functionality and for those cases it probably makes more sense for them to explicitly register positional arguments or sub-parsers. Add support for positional arguments via a 'required' Opt attribute: opt = StrOpt('foo', positional=True) conf.register_cli_opt(opt) conf(['bar']) conf.foo == 'bar' Change-Id: Iea746d710237e1ea26c1ef4871643941d1df09bd
* | | Merge "Use stock argparse behaviour for optional args"Jenkins2012-11-161-2/+2
|\| |
| * | Use stock argparse behaviour for optional argsMark McLoughlin2012-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | optparse would print "Options" but argparse prints "optional arguments". The default argparse behaviour is fine, let's stick with that. Change-Id: Ib53a2581af9d776e9a7c1cd90eebe89b70034e57
* | | Merge "Use stock argparse --usage behaviour"Jenkins2012-11-161-3/+3
|\| |
| * | Use stock argparse --usage behaviourMark McLoughlin2012-11-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optparse would substitute the program name for %prog, but argparse requires %(prog)s. Also, optparse would print 'Usage:' whereas argparse prints 'usage:'. Neither optparse behaviour that's worth retaining, let's just use the default argparse behaviour. Change-Id: Ied2acb37c366f1a45aed72b6b76f11e2de23828e
* | | Merge "Use stock argparse --version behaviour"Jenkins2012-11-161-2/+2
|\| |
| * | Use stock argparse --version behaviourMark McLoughlin2012-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optparse prints the version to stdout, argparse prints the version to stderr. There's no need to preserve the old optparse behaviour, let's just stick with argparse behaviour. Change-Id: Ie141c72112a63149d098afa9db55a95a309e79d7
* | | Merge "Fix the log test so it uses the available context fields."Jenkins2012-11-151-0/+7
|\ \ \ | |/ / |/| |
| * | Fix the log test so it uses the available context fields.Angus Salkeld2012-11-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | logging_context_format_string in log.py references fields that don't exist in the common/context.py so we get errors like: --- File "/usr/lib64/python2.7/logging/__init__.py", line 467, in format s = self._fmt % record.__dict__ KeyError: 'project_id' Logged from file test_log.py, line 42 --- We could change the defaults in log.py but that might cause too much disruption to other projects. Change-Id: Ic3f6039baccb522b5eb2462a87b792c226ca13ef
* | | Merge "Completely remove cfg's disable_interspersed_args()"Jenkins2012-11-151-12/+0
|\ \ \ | |_|/ |/| |
| * | Completely remove cfg's disable_interspersed_args()Mark McLoughlin2012-11-151-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | The use case for disable_interspersed_args() is that nova-manage needs to be able to parse sub-commands. We now have a add_cli_subparsers() method which better supports this use case. Change-Id: I1fcd15889745fe4ddff0ac4bacf385004f9b61af
* | | Merge "argparse support for cfg"Jenkins2012-11-151-2/+47
|\| |
| * | argparse support for cfgLaurence Miao2012-11-151-2/+47
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * openstack/common/cfg.py Optparse is fading out since python 2.7, this patch will help openstack/common work on more advanded version of python(argparse). Now, disable_interspersed_args() has no effect. Added new method add_cli_subparsers, return argparse subparser, for usages such as subcommand. * tests/unit/test_cfg.py SubcommandTestCase added. Disabled test_disable_interspersed_args test entry for happiness of tox, temporarily. Modified test_help for port of argparse. * tools/pip-requires include argparse module for python 2.6 Change-Id: Ie5cbde1a92a92786d64dea0ddfcfbf288c29f960
* / Added initialize_service_hook for rpc.Service.Lianhao Lu2012-11-141-0/+18
|/ | | | | | | | | | | | | | | | | | | | | | This fixes the collector part of the bug 1075463. Declaring a consumer topic on the same rpc connection after the consume thread has started would result the eventlet raise RuntimeError exception. So all the declaring work should be done before calling rpc.conn.consume_in_thread(). If the manager of a rpc.Service wants to declare topic consumers other than the default ones created by rpc.Service.start(), it could define the following hook in the manager class: def initialize_service_hook(self, service): # # Do initialization work after rpc connection is created and before # starting consuming thread. # Params: # service: handle to the rpc.Service instance. Change-Id: I80001c32ee4e51e394fed827c91ad5e1eb0f94dc
* Add generate_uuid to uuidutils.Alex Meade2012-11-091-0/+7
| | | | | | | Currently many projects have their own nearly identical methods for generating uuids. This patch will change that. Change-Id: I0af348ddbdea658331e8e701dcf1f8a12d968479
* Merge "Remove unused imports from rpc test_common."Jenkins2012-11-051-2/+0
|\
| * Remove unused imports from rpc test_common.Russell Bryant2012-11-051-2/+0
| | | | | | | | Change-Id: Ib7eed482bf452bf171462f9200fde9a83abf4606
* | Merge "Tweak rpc.queue_get_for to deal with host=None."Jenkins2012-11-051-0/+4
|\|
| * Tweak rpc.queue_get_for to deal with host=None.Russell Bryant2012-11-051-0/+4
| | | | | | | | | | | | | | Make rpc.queue_get_for() just a tad more convenient by dealing with the case of host=None. In that case, just return the base topic. Change-Id: I2f55c2205c219df7481dd6e507caf7182622195b
* | Merge "Restore proper LoggerTestCase"Jenkins2012-11-051-6/+8
|\ \ | |/ |/|
| * Restore proper LoggerTestCaseEric Windisch2012-11-051-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Addresses bug #1075022 Addresses bug #1075028 LoggerTestCase was no longer running as another test was created with this name (presumably due to copy-paste) The duplicate has been renamed to a more appropriate name: LogLevelTestCase. Because LoggerTestCase was not executing, bitrot has occurred. This patch also addresses those resultant test failures. Change-Id: I4f3820ba748d20606bb484d0adbfe678fa1fa38d
* | Remove openstack.common.config and extensions.Russell Bryant2012-11-054-835/+0
| | | | | | | | | | | | | | | | | | | | Remove the config module. All core openstack projects are using the cfg module instead so no further development will be done on this module. Also remove the extensions module. This code was imported but there has been no attempt to get any projects to use it. Change-Id: I4a974ba1ea25e94fd55cad243cde5f1ef6a17289
* | Merge "Log CONF from ProcessLauncher.wait, like ServiceLauncher"Jenkins2012-11-051-1/+11
|\ \
| * | Log CONF from ProcessLauncher.wait, like ServiceLauncherDavid Ripton2012-10-311-1/+11
| |/ | | | | | | | | | | | | | | | | | | Fixes bug #1050380 In the unit tests, we need to call CONF so that the config-file option referenced by log_opt_values() is registered. We also need unregister the default_publisher_id option to workaround bug #107372. Change-Id: Icc63237ddf97aaa730c0484974ec05a3080f8f04
* | Creates uuidutils moduleZhongyue Luo2012-11-021-0/+33
| | | | | | | | | | | | | | | | Fixes bug #1070198 Implements UUID processing functions used across projects. Change-Id: Ife2c972cea727dc7e453008bcd5871607e883d5c
* | Move utils.execute to its own module.Michael Still2012-11-013-58/+84
| | | | | | | | | | | | | | Also move the exceptions raised to being local to the executils module. Change-Id: Ibb2445f92840b9ce4b52373b0b09adb3d6a4a897
* | Merge "move nova.common.deprecated to openstack-common"Jenkins2012-10-311-0/+53
|\ \ | |/ |/|
| * move nova.common.deprecated to openstack-commonSean Dague2012-10-311-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug #1070511 nova has a common deprecation path which lets you turn deprecation warnings into fatal errors via config. Make this a function of the openstack common log to make it available to other projects in a standard way. Include exception directly in logging module. Update exception to work correctly now that it's not based off of nova's exception class. Change-Id: I699e776c99c429e60dfb5cd6c0cdbb661bae0ce8
* | cfg: fix required if option has a dashJulien Danjou2012-10-261-0/+8
|/ | | | | | | | | If an option has a dash in it and is required, the check fails because it tries to self._get() on the name (with dash) rather than the dest (with underscore). Change-Id: I6448019f70f98bc2e58a325d0cf9ce88b8bb085b Signed-off-by: Julien Danjou <julien@danjou.info>
* Move nova's util.synchronized decorator to openstack common.Michael Still2012-10-182-0/+202
| | | | | | | In the end I needed to port utils.ensure_tree as well. Resolves bug 1063230. Change-Id: I6e6fa8201de2cac3f17e6c60d7b16f7df7c64116
* Merge "Use self.config in test_zmq"Jenkins2012-10-161-7/+5
|\
| * Use self.config in test_zmqEric Windisch2012-10-111-7/+5
| | | | | | | | | | | | Fixes bug 1034416 Change-Id: I06f9fb5fa9d86eefeebc82c0e31196b8d542c9e0
* | Merge "Revert "Add support for finer-grained policy decisions""Jenkins2012-10-121-127/+5
|\ \
| * | Revert "Add support for finer-grained policy decisions"Mark McLoughlin2012-10-111-127/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3fc46892 After a productive discussion here: http://lists.openstack.org/pipermail/openstack-dev/2012-October/thread.html#1566 It appears that we don't yet have a really compelling use case for this and folks are worried about the extra complexity it brings. I think it's safe to say there's a consensus that we shouldn't proceed with this idea yet. We can always revisit this again later if needs be.
* | Merge "Added is_newer_than function"Jenkins2012-10-111-0/+12
|\ \ | |/ |/|
| * Added is_newer_than functionSirisha Devineni2012-10-091-0/+12
| | | | | | | | | | | | | | | | | | | | Added is_newer_than function to compare if the provided time is newer than current time for specified number of seconds Fixes bug 1036343 Change-Id: Ic133b0e7e2337b6b0fdad244ded6a93f8db48379
* | Add support for finer-grained policy decisionsKevin L. Mitchell2012-10-091-5/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements blueprint fine-grained-policy Add support to the new policy language for finer-grained policy decisions: policy checks can, using the "case" construct, return values other than simply "True". This means that a policy rule can be written that allows for fine shades of permissions; for instance, a rule could return the values, "fulladmin", "projectadmin", or False, and the caller can use these values to decide whether to allow all modifications, only some modifications, or no modifications at all. Change-Id: Id2bbee5c34052692af12e4a028256131ed2747fc
* | Add a 'not' operator to the policy langageKevin L. Mitchell2012-10-091-2/+36
| | | | | | | | | | | | | | | | | | Implements blueprint fine-grained-policy Inverting the sense of a check was not possible with the list-of-lists syntax, but it clearly makes sense to support it. Change-Id: Ibd92cd75a279efdafec16a26f9aec33f39614b5c
* | Add a new policy languageKevin L. Mitchell2012-10-091-0/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements blueprint fine-grained-policy Add a new policy language with "and" and "or" operators to replace the old list-of-lists syntax. New '@' and '!' operators are also added. This new language will enable us add more advanced features than the old syntax would have allowed. Backwards compat support for the old list-of-list syntax is retained. Change-Id: I872cb6abf6f8051c3ff502a0fc7590cff4f63a25
* | Remove deprecated policy engine APIsMark McLoughlin2012-10-091-139/+0
| | | | | | | | | | | | | | | | | | Implements blueprint fine-grained-policy Remove the deprecated Brain/enforce API and support for using functions as check types. Change-Id: Idf79999ad402b2c79072d0547d60c7b0bfa20d5a
* | Rewrite the policy engine from scratchKevin L. Mitchell2012-10-091-305/+452
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements blueprint fine-grained-policy Complete rewrite of the policy engine, with careful thought given to backwards-compatibility. Policy rules are now represented internally by a tree of Check objects. A new API is added for parsing and enforcing rules: set_rules(Rules.load_json(data, default_rule=...)) result = check(rule, target, credentials) reset() The old Brain/enforce API is deprecated and will be removed soon. A new API is also added for registering new check types: @register("key") class KeyCheck(Check): def __call__(self, target, creds): return self.match in creds Support for using functions as check types is deprecated and will also be removed soon. Change-Id: I2951a0de3751bd2ec868e7a661070fed624e4af2
* Merge "Add the rpc service and delete manager"Jenkins2012-09-272-3/+49
|\
| * Add the rpc service and delete managerAngus Salkeld2012-09-262-3/+49
| | | | | | | | | | | | Part of blueprint service-infrastructure Change-Id: Ie00efcb1c974d699ac6b2a38285abef1b295f3ce
* | Add exchange_name parameter to TopicConsumerJulien Danjou2012-09-272-0/+109
| | | | | | | | | | | | | | | | | | | | | | In Ceilometer, we need to consume messages from different exchanges of type 'topic', so being able to specify the exchange name rather than using the default in TopicConsumer is necessary. This fixes bug #1055483 Change-Id: Ibbaec8496f24c0b221cf489258af1e7fe362e84a Signed-off-by: Julien Danjou <julien@danjou.info>
* | Extracted parse_host_port into network_utils.Eugene Kirpichov2012-09-262-17/+42
| | | | | | | | Change-Id: I77bcbf03a18659cfa62e99da9ba2136f8348022b
* | Merge "Support for several HA RabbitMQ servers."Jenkins2012-09-251-17/+131
|\ \
| * | Support for several HA RabbitMQ servers.Eugene Kirpichov2012-09-251-17/+131
| | | | | | | | | | | | | | | | | | | | | | | | Use the rabbit_ha_queues boolean option. It is off by default, and you need to wipe RabbitMQ Mnesia database (/var/lib/rabbitmq/mnesia) when changing it. Change-Id: Id06692a142d1e5316602f6ceed4ccad615ce74c1