302 Commits

Author SHA1 Message Date
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
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
Mehdi Abaakouk
42ce3ab4b5 Remove the partial implementation of ack_on_error
The ack_on_error is not used by the abstraction layer, and only the
rabbitmq implements it.

This commit remove this feature, and next commit will add a new way for
this.

Partial implements blueprint notification-subscriber-server

Change-Id: I17eb23f2e3e374630251576438011f186e5b2150
2013-12-05 13:49:35 +01:00
Jenkins
3a2287c9e6 Merge "Ensure context type is handled when using to_dict" 2013-12-05 09:27:48 +00:00
Jenkins
e58636c26a Merge "Properly reconnect subscribing clients when QPID broker restarts" 2013-12-05 09:10:27 +00:00
Nikhil Manchanda
1a2377c485 Fixed misspellings of common words
Fixed misspelling of common words found by the misspellings tool.

Change-Id: I4dfa38e84e09fc08fdecf025663351ca62e09fd8
Closes-Bug: #1257531
2013-12-04 15:39:18 -08:00
Jenkins
566c40e92d Merge "Remove vim header" 2013-12-04 05:28:53 +00:00
Jenkins
d5285e9bda Merge "Unify different names between Python2/3 with six.moves" 2013-12-04 05:28:52 +00:00
Mark McLoughlin
2937692464 Add release notes for 1.3.0a2
Change-Id: If4cf83d605801047053530ca5c7970e30132b4b0
2013-12-03 23:18:42 +00:00
Chang Bo Guo
ae60d4ad77 Unify different names between Python2/3 with six.moves
Some modules use different names in Python2 and Python3. Use six.moves
to make them work well in Python2 and Python3.
This is changes mapping:

six.moves      Python 2       Python 3
reduce         reduce()      functools.reduce()

Implements: blueprint make-python3-compatible
Change-Id: I97971f2ab40385bfc2c73ae7e8a7620c4d64a03c
2013-12-03 22:17:03 +00:00
Joe Gordon
5d046a5c97 Remove vim header
No need to set tabstop 189 times, this can be set in your vimrc file
instead.  Also if set incorrectly gate (pep8 check) will catch your
mistakes.

Change-Id: Ic6f0c0ef94e8194a5c121598305d1ec3c74e4843
2013-12-03 15:44:24 +00:00
Lance Bragstad
d04fab6985 Ensure context type is handled when using to_dict
Handle the case where the context passed into def pack_context() is a
dictionary. If a dictionary is passed in, we don't need to call to_dict
before updating the msg.

Closes-Bug: #1208971
Change-Id: I2ce0b28f97634e717868e0ee5525189338d4981c
2013-12-03 15:44:07 +00:00
Zhongyue Luo
ab867fb7d0 Refactors boolean returns
Return the boolean evaluation itself rather than
a boolean after evaluation

Change-Id: I6329d474c921e29eb3a690270de12d51cb863710
2013-12-03 15:43:19 +00:00
Jenkins
fda06f6806 Merge "Remove useless global vars / import" 2013-12-03 13:34:30 +00:00
Julien Danjou
2b9bafd269 Simplify common base exception prototype
It seems there's no gain in trying to be smarter and different from the
base Python Exception, so let's remove our custom code to be more
compatible and friendly with all Python versions.

Change-Id: I259783ef1f77c6661ea7dc2325605c8d6290b898
2013-12-03 11:23:17 +01:00
Kenneth Giusti
ffa5c077c9 Properly reconnect subscribing clients when QPID broker restarts
When the QPID broker is restarted (or fails over), subscribed clients
will attempt to re-establish their connections.  In the case of fanout
subscriptions, this reconnection functionality is broken. For version
1 topologies, the clients attempt to reconnect twice to the same
exclusive address - which is illegal.  In the case of version 2
topologies, the address parsing is broken and an illegal address is
created on reconnect.  This fix avoids the problem by removing the
special-case reconnect code that manages UUID addresses; it is
unnecessary as the QPID broker will generate unique queue names
automatically when the clients reconnect.

Closes-bug: #1251757
Change-Id: I6051fb503663bb8c7c5468db6bcde10f6cf1b318
2013-12-02 17:42:51 -05:00
Julien Danjou
97b9deca88 Remove useless global vars / import
This removes a few import and global variables that are not used through
the code. That cleans things a little.

Change-Id: I7b30bb11e8ad3c2df01ca2107eff2444feed3fe2
2013-12-02 15:26:53 +01:00
Jenkins
86b0750f3e Merge "Avoid storing configuration in notifier" 2013-11-29 20:58:14 +00:00
Julien Danjou
41c629dc03 Avoid storing configuration in notifier
The notifier itself doesn't use the configuration. So let's not store
it, that lights the dependency a bit on this configuration object.

Blueprint: messaging-decouple-cfg

Change-Id: Ic4b5ddd93ea0382bd8292f9e31b7dacba9b489d3
2013-11-29 17:51:41 +01:00
Julien Danjou
f9ab2e105f Implement a log handler using notifier
Change-Id: Iccac043d46a733e965b3310bbbe9c7d6c07a46ac
Blueprint: logging-and-notification
2013-11-29 16:15:09 +01:00
Julien Danjou
010163d8ee notifier: add audit level
This maps what is provided by the openstack.common.logging module.

Change-Id: Id581c4c748e2763a2c9a3e576e3bd497595adbff
2013-11-29 14:47:03 +01:00
Julien Danjou
5912b58233 Add 'warning' as an alias to 'warn'
The standard Python logging system uses 'warning' and not 'warn'. To
ease compatibility with it, let's add 'warning' too.

Change-Id: I7778d7960ca7a72be007cb083e5434ede6e3fe6e
2013-11-27 10:39:19 +01:00
Jenkins
f137822ab0 Merge "Supply missing argument to raise_invalid_topology_version()" 2013-11-26 21:50:22 +00:00
Chang Bo Guo
c98d7edef8 Decouple from Oslo uuidutils module
uuidutils module will be deprecated in Icehouse, So need replace it.
This patch uses str(uuid.uuid4()) instead of method generate_uuid.

Closes-Bug: #1253497
Change-Id: I35815544429c489096b4db3fa79a649f4cd9459f
2013-11-22 19:59:03 -08:00
Kenneth Giusti
9ea06bac57 Supply missing argument to raise_invalid_topology_version()
Change-Id: I110255fd426e61840989a520a8f3708dc4d9b8ab
2013-11-15 15:29:19 -05:00
Russell Bryant
7e1fddb217 Support a new qpid topology
There has been a bug open for a while pointing out that the way we
create direct exchanges with qpid results in leaking exchanges since
qpid doesn't support auto-deleting exchanges.  This was somewhat
mitigated by change to use a single reply queue.  This meant we created
far fewer direct exchanges, but the problem persists anyway.

A Qpid expert, William Henry, originally proposed a change to address
this issue.  Unfortunately, it wasn't backwards compatible with existing
installations.  This patch takes the same approach, but makes it
optional and off by default.  This will allow a migration period.

As a really nice side effect, the Qpid experts have told us that this
change will also allow us to use Qpid broker federation to provide HA.

DocImpact
Closes-bug: #1178375
Co-authored-by: William Henry <whenry@redhat.com>
Change-Id: I09b8317c0d8a298237beeb3105f2b90cb13933d8
2013-11-15 14:05:37 -05:00
Jenkins
2414524c6e Merge "Remove hosts as property in TransportURL" 2013-11-14 14:47:45 +00:00
Jenkins
6490ad672e Merge "Remove property on virtual_host in TransportURL" 2013-11-14 14:46:44 +00:00
Julien Danjou
2545a5d806 Remove hosts as property in TransportURL
There's no need to use this indirection there.

Change-Id: Ia0d247693509f14b1a0a2faffb7da8884c679170
2013-11-12 18:22:10 +01:00
Julien Danjou
c65bfb7a55 Remove property on virtual_host in TransportURL
This isn't useful at all.

Change-Id: I1025da66a0f382cc3ecec15acf01890d75257a6a
2013-11-12 18:22:06 +01:00