Merge lp:~james-w/python-oops-dictconfig/ssl into lp:python-oops-dictconfig

Proposed by James Westby
Status: Needs review
Proposed branch: lp:~james-w/python-oops-dictconfig/ssl
Merge into: lp:python-oops-dictconfig
Diff against target: 56 lines (+22/-2)
3 files modified
README (+3/-1)
oops_dictconfig/dictconfig.py (+2/-1)
oops_dictconfig/tests/test_dictconfig.py (+17/-0)
To merge this branch: bzr merge lp:~james-w/python-oops-dictconfig/ssl
Reviewer Review Type Date Requested Status
Canonical Consumer Applications Hackers Pending
Review via email: mp+238327@code.launchpad.net

Commit message

Enable optional SSL in the amqp publisher.

To post a comment you must log in.

Unmerged revisions

20. By James Westby

Enable optional SSL in the amqp publisher.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README'
--- README 2014-01-08 10:56:04 +0000
+++ README 2014-10-14 16:51:54 +0000
@@ -87,7 +87,9 @@
8787
88 * routing_key: The routing key for messages.88 * routing_key: The routing key for messages.
8989
90There is one other optional key for the amqp publisher:90There are two other optional keys for the amqp publisher:
91
92 * ssl: whether to use SSL for the amqp connection.
9193
92 * inherit_id If True any 'True' 'id' in an OOPS report is94 * inherit_id If True any 'True' 'id' in an OOPS report is
93 preserved. Handy if an id that has already been shown95 preserved. Handy if an id that has already been shown
9496
=== modified file 'oops_dictconfig/dictconfig.py'
--- oops_dictconfig/dictconfig.py 2014-01-08 10:56:04 +0000
+++ oops_dictconfig/dictconfig.py 2014-10-14 16:51:54 +0000
@@ -32,7 +32,8 @@
32 userid=args['user'],32 userid=args['user'],
33 password=args['password'],33 password=args['password'],
34 virtual_host=args['vhost'],34 virtual_host=args['vhost'],
35 insist=False35 insist=False,
36 ssl=publisher_defn.get('ssl', False),
36 )37 )
37 kwargs = {}38 kwargs = {}
38 if 'inherit_id' in publisher_defn:39 if 'inherit_id' in publisher_defn:
3940
=== modified file 'oops_dictconfig/tests/test_dictconfig.py'
--- oops_dictconfig/tests/test_dictconfig.py 2014-01-08 10:56:04 +0000
+++ oops_dictconfig/tests/test_dictconfig.py 2014-10-14 16:51:54 +0000
@@ -242,6 +242,23 @@
242 False,242 False,
243 publishers[0].connection_factory.keywords['insist'])243 publishers[0].connection_factory.keywords['insist'])
244244
245 def test_amqp_sets_ssl_False_by_default(self):
246 publisher_defn = self.get_basic_ampq_definition()
247 config = self.get_config_from_dict([publisher_defn])
248 publishers = get_publishers_from_function(config.publisher)
249 self.assertEqual(
250 False,
251 publishers[0].connection_factory.keywords['ssl'])
252
253 def test_amqp_sets_ssl(self):
254 publisher_defn = self.get_basic_ampq_definition()
255 publisher_defn['ssl'] = True
256 config = self.get_config_from_dict([publisher_defn])
257 publishers = get_publishers_from_function(config.publisher)
258 self.assertEqual(
259 True,
260 publishers[0].connection_factory.keywords['ssl'])
261
245 def test_amqp_sets_inherit_id(self):262 def test_amqp_sets_inherit_id(self):
246 publisher_defn = self.get_basic_ampq_definition()263 publisher_defn = self.get_basic_ampq_definition()
247 publisher_defn['inherit_id'] = True264 publisher_defn['inherit_id'] = True

Subscribers

People subscribed via source and target branches