~ubuntu-branches/ubuntu/trusty/ceilometer/trusty-proposed

« back to all changes in this revision

Viewing changes to ceilometer/openstack/common/rpc/impl_qpid.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, James Page, Chuck Short
  • Date: 2014-01-23 15:08:11 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140123150811-1zaismsuyh1hcl8y
Tags: 2014.1~b2-0ubuntu1
[ James Page ]
* d/control: Add python-jsonpath-rw to BD's.
* d/p/fix-setup-requirements.patch: Bump WebOb to support < 1.4.
 (LP: #1261101)

[ Chuck Short ]
* New upstream version.
* debian/control, debian/ceilometer-common.install: Split out
  ceilometer-alarm-evaluator and ceilometer-alarm-notifier into their
  own packages. (LP: #1250002)
* debian/ceilometer-agent-central.logrotate,
  debian/ceilometer-agent-compute.logrotate,
  debian/ceilometer-api.logrotate,
  debian/ceilometer-collector.logrotate: Add logrotate files, 
  thanks to Ahmed Rahal. (LP: #1224223)
* Fix typos in upstart files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
import functools
17
17
import itertools
18
18
import time
19
 
import uuid
20
19
 
21
20
import eventlet
22
21
import greenlet
24
23
import six
25
24
 
26
25
from ceilometer.openstack.common import excutils
27
 
from ceilometer.openstack.common.gettextutils import _  # noqa
 
26
from ceilometer.openstack.common.gettextutils import _
28
27
from ceilometer.openstack.common import importutils
29
28
from ceilometer.openstack.common import jsonutils
30
29
from ceilometer.openstack.common import log as logging
123
122
                    },
124
123
                },
125
124
                "link": {
126
 
                    "name": link_name,
127
125
                    "durable": True,
128
126
                    "x-declare": {
129
127
                        "durable": False,
138
136
                "link": {
139
137
                    "x-declare": {
140
138
                        "auto-delete": True,
 
139
                        "exclusive": False,
141
140
                    },
142
141
                },
143
142
            }
145
144
            raise_invalid_topology_version()
146
145
 
147
146
        addr_opts["link"]["x-declare"].update(link_opts)
 
147
        if link_name:
 
148
            addr_opts["link"]["name"] = link_name
148
149
 
149
150
        self.address = "%s ; %s" % (node_name, jsonutils.dumps(addr_opts))
150
151
 
219
220
        if conf.qpid_topology_version == 1:
220
221
            node_name = "%s/%s" % (msg_id, msg_id)
221
222
            node_opts = {"type": "direct"}
 
223
            link_name = msg_id
222
224
        elif conf.qpid_topology_version == 2:
223
225
            node_name = "amq.direct/%s" % msg_id
224
226
            node_opts = {}
 
227
            link_name = None
225
228
        else:
226
229
            raise_invalid_topology_version()
227
230
 
228
231
        super(DirectConsumer, self).__init__(conf, session, callback,
229
 
                                             node_name, node_opts, msg_id,
 
232
                                             node_name, node_opts, link_name,
230
233
                                             link_opts)
231
234
 
232
235
 
278
281
        if conf.qpid_topology_version == 1:
279
282
            node_name = "%s_fanout" % topic
280
283
            node_opts = {"durable": False, "type": "fanout"}
281
 
            link_name = "%s_fanout_%s" % (topic, uuid.uuid4().hex)
282
284
        elif conf.qpid_topology_version == 2:
283
285
            node_name = "amq.topic/fanout/%s" % topic
284
286
            node_opts = {}
285
 
            link_name = ""
286
287
        else:
287
288
            raise_invalid_topology_version()
288
289
 
289
290
        super(FanoutConsumer, self).__init__(conf, session, callback,
290
 
                                             node_name, node_opts, link_name,
 
291
                                             node_name, node_opts, None,
291
292
                                             link_opts)
292
293
 
293
 
    def reconnect(self, session):
294
 
        topic = self.get_node_name().rpartition('_fanout')[0]
295
 
        params = {
296
 
            'session': session,
297
 
            'topic': topic,
298
 
            'callback': self.callback,
299
 
        }
300
 
 
301
 
        self.__init__(conf=self.conf, **params)
302
 
 
303
 
        super(FanoutConsumer, self).reconnect(session)
304
 
 
305
294
 
306
295
class Publisher(object):
307
296
    """Base Publisher class."""