summaryrefslogtreecommitdiffstats
path: root/tests/unit/rpc/test_proxy.py
Commit message (Collapse)AuthorAgeFilesLines
* Add can_send_version() to RpcProxy.Russell Bryant2013-06-111-0/+10
| | | | | | | | Add a helper method to the RpcProxy class. This is a little nicer to use for checking to see if a given message is copmatible with the set version cap. Change-Id: Ic44d76f4181351dff367f2d1181a3d508a11db78
* Add generic serialization supportDan Smith2013-05-211-0/+35
| | | | | | | | | | | | This adds a generic serialization model that the RpcProxy and RpcDispatcher will use to serialize and deserialize arguments and return values. The base definition is provided, as well as a default NoOpSerializer which performs no special action (retaining the existing behavior). Related to blueprint rpc-object-serialization Change-Id: I0a33baddee3e28dfc47100eb3216b679558b0bdd
* Allow RPC_API_NAMESPACE on RpcProxy objectsChris Behrens2013-05-201-2/+13
| | | | | | | | | | This allows one to subclass RpcProxy for use with a particular namespace without having to repeatedly pass the namespace into the make_namespaced_msg() method. This new RPC_API_NAMESPACE attribute will be used for the make_msg() call. It is defaulted to None to match previous behavior. Change-Id: Ied62df839cda0be6f9f9b060bbfc22e086f61be8
* Merge "Fixes import order nits"Jenkins2013-05-161-1/+1
|\
| * Fixes import order nitsZhongyue Luo2013-05-151-1/+1
| | | | | | | | Change-Id: I4fdc8eed74dd90d6450864daba7492d5e7266448
* | Support capping message versions in the client.Russell Bryant2013-05-151-0/+6
|/ | | | | | | | | | | | | | | | | | | When doing a rolling upgrade, we need to be able to tell all rpc clients to hold off on sending newer versions of messages until all nodes understand the new message version. This patch adds the oslo component of this. It's quite simple. The rpc proxy just stores the version cap and will raise an exception if code ever tries to send a message that exceeds this cap. Allowing the cap to be configured and generating different types of messages based on the configured value is the hard part here, but that is left up to the project using the rpc library. Implements blueprint rpc-version-control. Change-Id: Ia69db03a80dc3b1c63d52c7e163ea3cfec80c882
* Convert unicode for python3 portabilityChuck Short2013-05-061-1/+3
| | | | | | | | | | | | | From http://docs.python.org/3.1/whatsnew/3.0.html: "Python 3.0 uses the concepts of text and (binary) data instead of Unicode strings and 8-bit strings." Use six.text_type to Type for representing (Unicode) textual data. This is unicode() in Python 2 and str in Python 3. Change-Id: I3da268a714a34a8e626a2590f01b86e414dc3411 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Add rpc method namespace support.Russell Bryant2013-04-121-2/+10
| | | | | | | | | | | | | | | | | | | | | | RPC endpoints already had the ability to expose multiple APIs ... sort of. You could pass multiple callback objects to the dispatcher and it would check all of them for a method call. This patch adds the ability to set a namespace on a callback object. This makes exposing multiple APIs a bit more like you would expect it to work. You can invoke a method on a specific callback object, as opposed to having it check all of them for the method. This will allow you to create, manage, and version APIs without any potential conflicts with other APIs being exposed by the same endpoint. An example of where I would like to use this is in Nova, where we have some methods that we would like to expose on *all* rpc endpoints. This includes no public API changes and is fully backwards compatible. Implement blueprint rpc-multi-api. Change-Id: Ief4433e2e1c32cfb05b4cd27b87fe32b40f4341d
* Update to use flake8.Monty Taylor2013-03-241-1/+0
| | | | | | | flake8 is pluggable and handles pep8 and pyflakes, as well as configuration through tox.ini. It also removes the need for flakes.py. Change-Id: If5f7d8ad348b4fb8119fa4ec7b5e9d17bdc72a39
* Improves Logging for for rpc method timeoutsMatthew Sherborne2013-03-221-21/+39
| | | | | | | | | | | | | | | | | | | This patch moves the traceback for an rpc timeout from inside an iterator, which gave a useless traceback, into the main flow of the program. It also adds the rpc method being called and the topic used to the exception's message. When the caller logs the message higher up the stack, the log information and traceback will be more useful. Finally it removes the timeout logging in the amqp.py module, in the spirit of bug #1137994 and https://review.openstack.org/#/c/23295/ Works towards: bug #1148516 Change-Id: I29a3b1b97c6114c4479e2b71c1257c4d72131535
* Removes unused imports in the tests moduleZhongyue Luo2013-03-201-1/+0
| | | | | | Fixes bug #1157596 Change-Id: I36d5484eaa2f0e21188eed6e70cc1ad785233d6a
* Emit a warning if RPC calls made with lock.Michael Still2013-02-061-0/+13
| | | | | | | | | | | | | | This patch will log a warning every time a RPC call is made while a lock is held if the caller has requested it. This should help us track down performance problems such as the security group refresh problem recently found in nova. RPC calls can emit a warning if called with check_for_lock=True and debugging is turned on. Sneaks up on bug 1063222. Change-Id: Ice94093efb3cb95dd58b31d6ba817c7d505c15af
* Replaced direct usage of stubout with BaseTestCase.Monty Taylor2013-01-241-7/+2
| | | | | | | | BaseTestCase properly hooks stubout into fixtures. Just use that. Part of blueprint grizzly-testtools. Change-Id: I4bf6b92b9b16d051d8c6ecaf52cf70925848ed8c
* Use testtools as test base class.Monty Taylor2013-01-241-8/+4
| | | | | | | | | | | | | On the path to testr migration, we need to replace the unittest base classes with testtools. Replace tearDown with addCleanup, addCleanup is more resilient than tearDown. The fixtures library has excellent support for managing and cleaning tempfiles. Use it. Replace skip_ with testtools.skipTest Part of blueprint grizzly-testtools. Change-Id: I45e11bbb1ff9b31f3278d3b016737dcb7850cd98
* Update common code to support pep 1.3.Gary Kotton2012-06-181-4/+5
| | | | | | bug 1014216 Change-Id: I3f8fa2e11c9d3f3d34fb20f65ce886bb9c94463d
* Add rpc to openstack-common.Russell Bryant2012-06-061-0/+128
Implements blueprint common-rpc. This patch imports nova.rpc to openstack-common. All of the necessary changes to the core code to make it compatible with openstack-common have been done in nova, so the only changes made here are to imports. There are more changes made to the tests, but nothing that changes the core functionality of the tests. Change-Id: I17330aa4adfd0f22c449a2376833c7fe9dfd0cf1