141 Commits

Author SHA1 Message Date
Mark McLoughlin
1a7e51eb4a Use stdlib logging
I guess this loses us automatic logging of details from request context.

Change-Id: I7413f025231c14b7cbdc9e90099407bc6c7943e1
2013-07-24 08:15:35 +01:00
Mark McLoughlin
e3c5b99959 Port away from some eventlet infrastructure
Add a simple object pool implementation for our connection pool, in
place of eventlet.pools.Pool.

Also use threading.Lock in place of eventlet.Semaphore.

There are still some eventlet modules imported by the code, but we can
avoid using them at runtime and clean things up later. We can't remove
them now or it'll cause pep8 failures.

Change-Id: I380408d1321802de813de541cd0a2d4305c3627c
2013-07-24 08:15:34 +01:00
Mark McLoughlin
37bd6923dc Don't register options with cfg.CONF at module import
oslo.messaging will only register options with a ConfigOpts object
supplied by the caller.

Change-Id: I18115e9dd5241b1bdfae14671a62328c47125400
2013-07-24 08:15:34 +01:00
Mark McLoughlin
04dd4e1773 Adjust imports in rabbit/qpid drivers
Some modules are in oslo.messaging.openstack.common and others are in
oslo.messaging._drivers.

Change-Id: I3581eff3427858c8f46673e4a3c376367c626bb3
2013-07-24 08:15:34 +01:00
Jenkins
1c739eb89f Merge "Import some needed modules from oslo-incubator" 2013-07-24 07:13:33 +00:00
Jenkins
0c9c41d290 Merge "Add oslo-incubator code unmodified" 2013-07-24 07:13:19 +00:00
Jenkins
6a2bf86898 Merge "Make executor threads more robust" 2013-07-24 07:12:31 +00:00
Mark McLoughlin
51be674f30 Import some needed modules from oslo-incubator
Some additional modules from oslo-incubator are required by the driver
code. Don't fret, some of these will be removed in subsequent patches!

Change-Id: I3674bfbc4b1c93afc746b84fbbf8859456cbcb3c
2013-07-23 18:34:42 +01:00
Mark McLoughlin
e91dbef454 Add oslo-incubator code unmodified
I want to make it absolutely clear what changes we're making from the
original driver code, so let's start with a pristine copy.

Change-Id: I38507382b1ce68c7f8f697522f9a1bf00e76532d
2013-07-23 18:34:42 +01:00
Mark McLoughlin
43ab36d1a1 Make executor threads more robust
See bug #1189711

Prevent the executor thread getting killed by exceptions.

Change-Id: I0787fa619a6a8a35a303627f8ce119c93f2c8765
2013-07-23 18:34:42 +01:00
Sergey Lukjanov
8eeaf67be9 Allow use of hacking 0.6.0 and fix min version
Change-Id: I91d8eafc2fa50cb4fab4df2960274be2f5c237a4
2013-07-20 00:55:36 +04:00
Mark McLoughlin
837aa03c43 Include docstrings in published docs
Change-Id: Icdfb0535b26162d39c3af683b7729b5e834d89b9
2013-07-10 09:33:13 +01:00
Mark McLoughlin
3e8c891d67 Use oslo.sphinx and remove local copy of doc theme
Use the new oslo.sphinx version of the OpenStack doc
theme instead of copying it into this repo.

blueprint oslo.sphinx

Change-Id: I0bd91f7bb43f97b99051fed65b75fc05d5149cc8
2013-07-10 08:51:37 +01:00
Mark McLoughlin
39f57dab59 Add some notes 2013-06-24 12:52:57 +01:00
Mark McLoughlin
7c087f23d2 Unit tests for notifier 2013-06-24 12:52:56 +01:00
Mark McLoughlin
fc99d966af Make test notifier useful
We need a way to query what notifications were sent to the test notifier
and later clear out that list.
2013-06-24 12:52:56 +01:00
Mark McLoughlin
75c376aab0 Use lowercase priority in log notifier 2013-06-24 12:52:56 +01:00
Mark McLoughlin
54d875bcac Use lowercase priority in notifications topic 2013-06-24 12:52:56 +01:00
Mark McLoughlin
4000eec07c Handle case where no drivers configured 2013-06-24 12:52:56 +01:00
Mark McLoughlin
89e7301e4e Fix buglet in v2 messaging notifier 2013-06-24 12:52:56 +01:00
Mark McLoughlin
ec9b36dec2 Make LOG private in notifier 2013-06-24 12:52:56 +01:00
Mark McLoughlin
351eb2d9e4 Require a transport to construct a Notifier
Rather than construct it from cfg.CONF by default, just require that one
is supplied.
2013-06-24 12:52:56 +01:00
Mark McLoughlin
cfeaf2a292 Add serializer support to notifier
The notifier in oslo-incubator does:

  payload = jsonutils.to_primitive(payload, convert_instances=True)

Using the serializer abstraction should be a more general was of
supporting this.
2013-06-24 12:52:56 +01:00
Mark McLoughlin
f17f00ba88 Rename context to ctxt in serializer API 2013-06-24 12:52:56 +01:00
Mark McLoughlin
fcfe15af04 Rename context to ctxt in notify API
ctxt is the name we've used in the rest of oslo.messaging, so ...
2013-06-24 12:52:56 +01:00
Mark McLoughlin
eb94be8834 Make Notifier public at top-level 2013-06-24 12:52:56 +01:00
Mark McLoughlin
b5e43afc37 Docstrings for notifier API 2013-06-24 12:52:41 +01:00
Mark McLoughlin
d0bb030d59 Fix notify drivers namespace 2013-06-24 12:52:41 +01:00
Mark McLoughlin
e03c2d4e9a Remove backwards compat entry point aliases
There's no point in supporting

  oslo.rpc.impl_kombu

since what we need to support is

  nova.openstack.common.rpc.impl_kombu
2013-06-24 12:52:31 +01:00
Mark McLoughlin
03aafcb49c Simplify public symbol exports
Inspired by tulip, have every module define a __all__ list and import *
from the top-level module.

Rename transport.set_defaults() since we don't want this to be a
top-level set_defaults() function as there may be multiple.

Also, rather than configuring flake8 to allow star imports, just exclude
the __init__.py files from flake8 checks.
2013-06-24 12:52:30 +01:00
Mark McLoughlin
d31ae442ca Use assertEqual() rather than assertEquals()
assertEquals() is deprecated:

  http://docs.python.org/2/library/unittest.html#deprecated-aliases
2013-06-17 23:01:21 +01:00
Mark McLoughlin
2f4d53921f Remove accidental use of messaging.rpc_server
Hmm, maybe this means we should use __all__ to avoid exporting these
imports.
2013-06-17 22:48:43 +01:00
Mark McLoughlin
5cd662a517 Make exchange_from_url() use parse_url() 2013-06-16 16:08:48 +01:00
Mark McLoughlin
3e3a13eefd Unit tests for URL parsing code 2013-06-16 15:58:03 +01:00
Mark McLoughlin
1a8adfbceb Fix parse_urls() buglets
When you expect split() to return 2 values, make sure to tell it to only
do a single split.
2013-06-16 15:58:02 +01:00
Mark McLoughlin
29cb5b0b58 Move url utils into messaging._urls 2013-06-16 15:27:36 +01:00
Mark McLoughlin
e67f409b87 Don't use common logging
It appears we don't actually need this - we don't, for example, use any
of the special formatting supported by ContextAdaptor.
2013-06-16 15:24:41 +01:00
Mark McLoughlin
1f1ba52e01 Update example scripts for recent API changes 2013-06-16 12:26:01 +01:00
Mark McLoughlin
9cb803ee10 Fix fake driver with eventlet
By storing the reply_q on the listener, we were assuming there was only
one message being dispatched at the time. Put it on the incoming message
instead and use it directly in reply().
2013-06-16 12:23:11 +01:00
Mark McLoughlin
fd68391d53 Use log.warning() instead of log.warn()
warn() is provided by ContextAdapter, there's no reason to use it.
2013-06-16 12:00:09 +01:00
Mark McLoughlin
daae091c7c Fix some pep8 issues 2013-06-16 11:57:47 +01:00
Mark McLoughlin
d821999629 Don't translate exception messages 2013-06-16 11:55:47 +01:00
Mark McLoughlin
563383b51d Knock off a few TODOs 2013-06-16 09:47:18 +01:00
Mark McLoughlin
293a34c156 Add can_send_version() to RPCClient
Add a helper method to the RPCClient class.  This is a little nicer to
use for checking to see if a given message is copmatible with the set
version cap.

This can be used in a bunch of different ways:

  client = RPCClient(version_cap='1.6', version='1.0')
  client.can_send_version()
  client.can_send_version(version='1.6')

  client = client.prepare(version_cap='1.8', version='1.5')
  client.can_send_version()
  client.can_send_version(version='1.2')

Co-authored-by: Russell Bryant <rbryant@redhat.com>
2013-06-16 09:39:09 +01:00
Mark McLoughlin
395d818d73 Check start() does nothing on a running server 2013-06-15 21:29:32 +01:00
Mark McLoughlin
24af12f053 Remove unused statements in base serializer 2013-06-15 21:27:11 +01:00
Mark McLoughlin
cf44b8d01d Fix thinko in exchange_from_url()
Funnily enough, this was just shown by the coverage report.
2013-06-15 21:25:34 +01:00
Mark McLoughlin
dd4b8bd672 Call wait() in server tests
Just for the sake of the coverage report.
2013-06-15 21:22:10 +01:00
Mark McLoughlin
0fc785267f Add docstrings for base executor class
Avoiding spurious missed lines in coverage report.
2013-06-15 21:20:26 +01:00
Mark McLoughlin
de88d62998 Remove a fixed fixme 2013-06-15 21:19:05 +01:00