summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | | 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
* | | Normalize_time() always return naive objectYunhong, Jiang2012-09-131-0/+20
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the timeutils.normalize_time() returns naive datetime object when parameter timestamp is an naive object or a non-UTC aware datetime object, and returns aware datetime object if parameter timestamp is a UTC aware datetime object. The basic problem here is that utcoffset() of None means the object is naive but a utcoffset() of zero means that the object is aware but represents UTC time. This is fragile implementation and will trigger potential issue, because aware/native datetime is not interoperatable. For example, "timeutils.utcnow() > timeutils.normalize_time(m)" will success at most time, while trigger TypeError if m is a UTC aware object. We want to normalize all objects into naive objects. Fixes bug 1048636 Change-Id: I4a09246fa8f0dd63ca54362b877aa825d9b79772 Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
* / Use pep8 v1.3.3Zhongyue Luo2012-09-134-33/+58
|/ | | | | | | Fixed indents which violate pep8 1.3.3 Also added .mailmap file to coalesce commits Change-Id: Ia7a788a28e6c0fd9cb52fb7ea477cddd7d589e58
* Merge "Make projects define 'control_exchange'."Jenkins2012-09-121-4/+4
|\
| * Make projects define 'control_exchange'.Russell Bryant2012-09-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'control_exchange' option needs to have a project-specific default value. Just don't register this option and expect it to be registered by the project using this code, at least for now. ****** IMPORTANT NOTE WHEN IMPORTING THIS CHANGE ****** If you are importing this change into a project that uses rpc, you must add the control_exchange option in your code! ******************************************************* Change-Id: Ida5a8637c419e709bbf22fcad57b0f11c31bb959
* | Added a method for parsing host:port pairs.Eugene Kirpichov2012-09-111-0/+17
|/ | | | | | | | | | | | 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
* Merge "Allow non-string items in the creds dict."Jenkins2012-08-311-0/+7
|\
| * Allow non-string items in the creds dict.Vishvananda Ishaya2012-08-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The generic checking in policy allows us to match against data from the creds_dict using a very simple syntax. For example, in policy.json if you had something like: "some_action": [["project_id:foo"]] it would only allow project foo to perform that action, but something like: "some_action": [["is_admin:True"]] where is_admin is a boolean fails. This modifies the check to convert the value to unicode before attempting to compare it. It includes a test. Fixes bug 1039132 Change-Id: I0e53a6ea2709212d4a1536f901bcf1e717a232ca
* | Regarding the mispelling of the Noble Narwhal.Matt Joyce2012-08-221-1/+1
|/ | | | | | | | | | | | | | | | | | | | The narwhal, or narwhale, Monodon monoceros, is a medium-sized toothed whale that lives year-round in the Arctic. One of two living species of whale in the Monodontidae family, along with the beluga whale, narwhal males are distinguished by a long, straight, helical tusk, actually an elongated upper left canine. Found primarily in Canadian Arctic and Greenlandic waters, rarely south of 65°N latitude, the narwhal is a uniquely specialized Arctic predator. In the winter, it feeds on benthic prey, mostly flatfish, at depths of up to 1500 m under dense pack ice. Narwhals have been harvested for over a thousand years by Inuit people in northern Canada and Greenland for meat and ivory, and a regulated subsistence hunt continues to this day. While populations appear stable, the narwhal has been deemed particularly vulnerable to climate change due to a narrow geographical range and specialized diet. Via Wikipedia Change-Id: I0aa6fb9a29f6e851eb2621d70d400e1505ae2d32