330 Commits

Author SHA1 Message Date
Jenkins
f81cde600b Merge "Expose an entry point to list all config options" 1.3.0a6 2014-01-28 06:17:56 +00:00
Jenkins
f397c4264b Merge "Fix test case name typo" 2014-01-28 06:13:36 +00:00
Jenkins
1d25c5ae20 Merge "Fix help strings" 2014-01-27 21:25:38 +00:00
Mark McLoughlin
0eb5a6f6c7 Expose an entry point to list all config options
Register a oslo.messaging entry point in the oslo.config.opts namespace
which, when called, returns a list of the configuration options which
may be registered by the library at runtime.

The idea here is that the sample config file generator can query this
and include the returned options in the sample config file of any
applications which use the library.

Some sample code for fetching available options:

  import pkg_resources

  for ep in pkg_resources.iter_entry_points('oslo.config.opts'):
      if ep.name == "oslo.messaging":
          list_opts = ep.load()
          for g, opts in list_opts():
              opts.sort(key=lambda x: x.name)
              print "[%s]" % g
              for o in opts:
                  print "%s = %s" % (o.name, o.default)
              print

Related-Bug: #1241566
Change-Id: Ic28351258652d2ea38974e2f4d1aa6b1d3dd7192
2014-01-27 11:24:52 +00:00
Mark McLoughlin
2ab150325b Fix test case name typo
This is just a copy-and-paste typo.

Change-Id: Ibe350ca650363749f88bbbc115898a8071129415
2014-01-27 10:39:20 +00:00
Jenkins
2862f502a6 Merge "Routing notifier" 1.3.0a5 2014-01-23 13:38:54 +00:00
Jenkins
258299d376 Merge "Add release notes for 1.3.0a3" 2014-01-22 11:23:44 +00:00
Andreas Jaeger
a5c7d6a2df Fix help strings
Use sentence style capitalization on help strings.

Change-Id: Ib3a8393eb0f3244d2ee431e71d3632195903b708
2014-01-18 16:16:19 +01:00
Mark McLoughlin
fff225538c Add release notes for 1.3.0a3
Change-Id: If97e1d695e498aac41aabbc1cea7cb9336b3b725
2014-01-17 12:38:51 +00:00
Dirk Mueller
60b6a9fe9d python3: Switch to mox3 instead of mox
In order to transition to a python 3.x compatible world,
lets switch to mox3 which is python 3.x compatible drop-in
replacement of mox.

Change-Id: Iaa22779cd516f842c9f70828f863f90ddae0bab5
2014-01-16 14:31:01 +01:00
Dirk Mueller
f5df5cb177 Remove dependencies on pep8, pyflakes and flake8
They should be determined by the hacking dependency
implicitely.

Change-Id: I2baec6b652baa2efbbf5dd2ead0eeb91b961210b
2014-01-16 13:05:13 +01:00
Sandy Walsh
30c9334306 Routing notifier
Takes a yaml-based config file
(see etc/oslo/routing_notifier.yaml.sample) via
routing_notifier_config option.

Events may be routed by priority or event_type.

Implements: blueprint configurable-notification
Change-Id: I437dfac348f387044e6da3d6a0bbb208323c1741
2014-01-15 04:08:18 +00:00
Zhongyue Luo
d3f3fd7759 Removes use of timeutils.set_time_override
The set_time_override function in timeutils was written as a
helper function to mock utcnow for unittests before 'mock' was
generally used. Now that we have mock and fixture, we no longer
need to use it.

Change-Id: I9a0727edab12ccd5f1e4eb4f5f62d588f5a0faee
Partial-Bug: #1266962
1.3.0a4 1.3.0a3
2014-01-13 08:00:36 +08:00
Jenkins
abfa7ff5e9 Merge "Fix duplicate topic messages for Qpid topology=2" 2014-01-12 23:17:34 +00:00
Jenkins
4f431ea652 Merge "Fix spelling errors in comments" 2014-01-11 17:06:08 +00:00
Jenkins
7f3e866a15 Merge "Fix test_notifier_logger for Python 3" 2014-01-11 07:36:40 +00:00
Jenkins
0fd4923e2f Merge "Fix try/except syntax for Python 3" 2014-01-11 07:36:30 +00:00
Stanislav Kudriashev
2e59af91ba Fix spelling errors in comments
Change-Id: I9f7de85912c687d37661c3301b5898960082fc13
2014-01-10 17:02:27 +02:00
Jenkins
21443273be Merge "fix test_rabbit for Python 3" 2014-01-10 01:38:31 +00:00
Jenkins
f3e03c9fff Merge "Minor Python 3 fixes" 2014-01-08 18:37:39 +00:00
Jenkins
04cb7223a5 Merge "Fix exception deserialiation on Python 3" 2014-01-08 18:35:26 +00:00
Victor Stinner
be5386ab36 Fix test_notifier_logger for Python 3
* Get the current line at runtime, don't hardcode the line number
 * Only strip last character of the filename if it ends with ".pyc"
   or ".pyo".  On Python 3, import automatically replaces .pyc and
   .pyo with .py.
 * Use threading.current_thread().ident to get the identifier of the
   current thread. The get_ident() function is available in thread
   module in Python 2, but in threading module in Python 3. And on
   Python 3, logging.thread symbol does not exist anymore.

Change-Id: I3f248bb860caafaf38eefcf440d36b9bebc8f05e
2014-01-07 18:14:53 +01:00
Victor Stinner
690868bc99 Minor Python 3 fixes
basestring does not exist anymore in Python 3: use six.string_types instead.

In "try: .../except Exception as err: ...", err is a local variable, it does no
more exist after the except block. Copy the exception in a new cls_error
variable to fix Python 3 support.

Extract of Python 3 documentation: "When an exception has been assigned using
as target, it is cleared at the end of the except clause. (...) Exceptions are
cleared because with the traceback attached to them, they form a reference
cycle with the stack frame, keeping all locals in that frame alive until the
next garbage collection occurs."

http://docs.python.org/3.3/reference/compound_stmts.html#try

Change-Id: I2efb14b3838f78d1ed5e09b3ccd4e796a3448aee
2014-01-07 11:29:13 +01:00
Eric Guo
84d5786f1a Remove copyright from empty files
According to policy change in HACKING:
http://docs.openstack.org/developer/hacking/#openstack-licensing
empty files should no longer contain copyright notices.

Closes-Bug: #1262424
Change-Id: I22d5881537cff120ae10b2fb3141c427d621214b
2014-01-04 10:33:58 +08:00
Ihar Hrachyshka
9ff4d99823 Fix duplicate topic messages for Qpid topology=2
Manually applied ef406a21782134aeefb944f74b3f1a47d6169318 from
oslo-incubator to get the fix required for bug 1257293.

Copying the original commit message from oslo-incubator below.

"""
When multiple RPC servers (consumers) are subscribed to the same RPC
topic, a single RPC request to that topic should be received by only
one of the consumers.  A bug in the QPID driver caused every consumer
to receive a copy of the RPC request.  This bug affects only Topology
version 2.  This patch will cause a single queue to be created for
each topic, and shared among all consumers of that topic.  This
results in each RPC request being received by only one consumer,
in turn across all the competing consumers.
"""

Change-Id: I76bfa5b48bad4a70fbf06b74f4cc8234af6610c2
Closes-bug: #1257293.
2014-01-03 11:15:44 +01:00
Victor Stinner
062c8ac7dd Replace dict.iteritems() with six.iteritems()
dict.iteritems() was replaced with dict.items() in Python 3. Use the
six.iteritems() function to get code compatible with Python 2 and Python 3.

Change-Id: I0c8ecc3ae540ffaf4c6b159e09ca16ccf365973d
2013-12-20 23:43:35 +01:00
Victor Stinner
4631118af8 fix test_rabbit for Python 3
Replace range() with list(range()), range() returns a read-only "range" object
in Python 3.

Change-Id: If92e60b426ccbba574e63e1603cc3d7507df6c98
2013-12-19 15:00:21 +01:00
Victor Stinner
43e9d5fef5 Fix try/except syntax for Python 3
"except (IOError, errors):" fails with a TypeError if errors is a tuple on
Python 3, whereas it was accepted in Python 2.

Change-Id: I65cfb60af87e76fdf2d37043fb106adbd4586fb9
2013-12-19 14:56:49 +01:00
Victor Stinner
fb5ace04ba Fix exception deserialiation on Python 3
Builtin exceptions are now in the builtins module, the exceptions module has
been removed.

Fix also the unit test for tracebacks, Unicode representation doesn't start
with "u" prefix anymore (u'...').

Change-Id: I422be457e23066699950c9a3999878ecf65f1b3f
2013-12-19 14:51:17 +01:00
Jenkins
64f91d30a8 Merge "sysnchronize oslo-incubator modules" 2013-12-17 22:49:04 +00:00
Jenkins
351118f577 Merge "Fix syntax of relative imports for Python3" 2013-12-17 22:35:20 +00:00
Jenkins
aa2d689f97 Merge "Add Sample priority" 2013-12-17 22:34:00 +00:00
Sandy Walsh
43884bfbb4 Add Sample priority
With the routing notifier we can now issue high-frequency notifications
and not worry about clogging up the queue. The Sample priority will
be used for this situation.

Change-Id: Ia4aa77b7aa4ca9458e97ca3ed81101d92934b691
2013-12-17 15:47:42 +00:00
Victor Stinner
f1cb11a550 sysnchronize oslo-incubator modules
Update to get jsonutils compatible with Python 3.

The babel Python module is now required by gettextutils, and gettextutils is
imported by excutils.

Change-Id: Ifa6d6b29e2af58dfcfda1ab7efdb2f32cf9de655
2013-12-17 10:46:40 +01:00
Mehdi Abaakouk
e57a15deb8 Remove eventlet related code in amqp driver
Because driver should rely on executor and not directly on eventlet,
delete eventlet related code. This also drop the old driver API.

This is the amqp part.

Change-Id: Ic6060058dafa4dabbc5e8c68bf231c818a7fec25
2013-12-16 17:30:36 +01:00
Victor Stinner
2aaad74bac Fix syntax of relative imports for Python3
In Python 3, relative imports must be written "from .module import name":
http://docs.python.org/3.0/whatsnew/3.0.html#removed-syntax

Change-Id: I2ec8a7330e63ea64d291f2f37f0c01cdf765d4f7
2013-12-16 10:56:07 +01:00
OpenStack Jenkins
33202134bd Updated from global requirements
Change-Id: Iec5cac6baeba71e6724fd6270f3d5dd87f1e730d
2013-12-10 23:44:54 +00:00
OpenStack Jenkins
db45e3be9f Updated from global requirements
Change-Id: I79a5e54f094fc219d1f5f12745811c3824966309
2013-12-10 00:18:49 +00:00
Jenkins
77c319d9a9 Merge "Avoid creating qpid connection twice in initialization" 2013-12-09 18:24:06 +00:00
Jenkins
9798825811 Merge "Unify different names between Python2 and Python3" 2013-12-09 18:24:05 +00:00
Jenkins
0d6d858805 Merge "Replace data structures' attribute with six module" 2013-12-09 18:24:04 +00:00
Chang Bo Guo
db9e8d3c61 Unify different names between Python2 and Python3
Some modules have different names in Python2 and Python3. This patch
make them compatible with Python 3.

 * Use six.moves.filter instead of itertools.ifilter() in Python 2.
 * Use common.py3kcompat.urlutils instead of urllib and urlparse.

Change-Id: Ia27ebf6057d91d0e129fbe90f995cfdaa89efa8a
2013-12-09 02:19:52 -08:00
Chang Bo Guo
b38b3a3c13 Replace data structures' attribute with six module
In Python 3, some data structures' attribute is different in Python 2.
See http://pythonhosted.org/six/#object-model-compatibility
This is change mapping:

   six               Python 2           Python 3
six.next(it)         it.next()          next(it)
six.iterkeys(dict)   dict.iterkeys()    dict.keys()
six.itervalues(dict) dict.itervalues()  dict.values()

Implements: blueprint make-python3-compatible
Change-Id: Ida48f39ff230860feee7305b93b134c625a21663
2013-12-09 08:17:59 +00:00
Chang Bo Guo
39d1dde432 Avoid creating qpid connection twice in initialization
In current logic, class impl_qpid.Connnection constructor calls
method connection_create twice indirectly. Let us avoid this.

Change-Id: I7618cf3506d857579dc37b338690d05179ba272d
2013-12-07 19:52:46 -08:00
Chang Bo Guo
2278ce0b95 Use six.moves.queue instead of Queue
The Queue module has been renamed to queue in Python 3.
Use six.moves.queue to fit the change.

http://docs.python.org/2/library/queue.html#module-Queue

Change-Id: I2940f34d161b2e3cbc5464619f76e6adea4ef9f6
2013-12-07 19:35:41 -08:00
Jenkins
1e8ef86626 Merge "Add transport aliases" 2013-12-07 10:14:14 +00:00
Jenkins
f0d32ef5f0 Merge "Fixed misspellings of common words" 2013-12-07 10:12:21 +00:00
Mark McLoughlin
5b8fbdcad2 Add transport aliases
We need to support deprecated transport driver configurations like:

 rpc_backend = nova.rpc.impl_kombu

i.e. 'nova.rpc.impl_kombu' is a deprecated alias for 'rabbit'.

Initially, we supported this by adding the aliases to each project's
setup.cfg:

oslo.messaging.drivers =
    nova.rpc.impl_kombu = oslo.messaging._drivers.impl_rabbit:RabbitDriver

However, this means that code like this:

  url = str(TransportURL(conf))

generates a bogus URL string like:

  nova.rpc.impl_kombu://...

We need to apply these transport aliases when we load drivers, but also
when we create transport URLs from configuration containing potentially
deprecated aliases.

To enable that, add an aliases parameter to TransportURL(),
TransportURL.parse() and get_transport().

blueprint: transport-aliases
Change-Id: Ifce68ff62746c2a363c719417a2bd0a78ee025dd
2013-12-06 19:18:18 +00:00
Jenkins
875acfc29b Merge "Remove the partial implementation of ack_on_error" 2013-12-06 17:34:06 +00:00
Jenkins
378506c79e Merge "Add release notes for 1.3.0a2" 2013-12-05 17:11:04 +00:00