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
1=== modified file 'README'
2--- README 2014-01-08 10:56:04 +0000
3+++ README 2014-10-14 16:51:54 +0000
4@@ -87,7 +87,9 @@
5
6 * routing_key: The routing key for messages.
7
8-There is one other optional key for the amqp publisher:
9+There are two other optional keys for the amqp publisher:
10+
11+ * ssl: whether to use SSL for the amqp connection.
12
13 * inherit_id If True any 'True' 'id' in an OOPS report is
14 preserved. Handy if an id that has already been shown
15
16=== modified file 'oops_dictconfig/dictconfig.py'
17--- oops_dictconfig/dictconfig.py 2014-01-08 10:56:04 +0000
18+++ oops_dictconfig/dictconfig.py 2014-10-14 16:51:54 +0000
19@@ -32,7 +32,8 @@
20 userid=args['user'],
21 password=args['password'],
22 virtual_host=args['vhost'],
23- insist=False
24+ insist=False,
25+ ssl=publisher_defn.get('ssl', False),
26 )
27 kwargs = {}
28 if 'inherit_id' in publisher_defn:
29
30=== modified file 'oops_dictconfig/tests/test_dictconfig.py'
31--- oops_dictconfig/tests/test_dictconfig.py 2014-01-08 10:56:04 +0000
32+++ oops_dictconfig/tests/test_dictconfig.py 2014-10-14 16:51:54 +0000
33@@ -242,6 +242,23 @@
34 False,
35 publishers[0].connection_factory.keywords['insist'])
36
37+ def test_amqp_sets_ssl_False_by_default(self):
38+ publisher_defn = self.get_basic_ampq_definition()
39+ config = self.get_config_from_dict([publisher_defn])
40+ publishers = get_publishers_from_function(config.publisher)
41+ self.assertEqual(
42+ False,
43+ publishers[0].connection_factory.keywords['ssl'])
44+
45+ def test_amqp_sets_ssl(self):
46+ publisher_defn = self.get_basic_ampq_definition()
47+ publisher_defn['ssl'] = True
48+ config = self.get_config_from_dict([publisher_defn])
49+ publishers = get_publishers_from_function(config.publisher)
50+ self.assertEqual(
51+ True,
52+ publishers[0].connection_factory.keywords['ssl'])
53+
54 def test_amqp_sets_inherit_id(self):
55 publisher_defn = self.get_basic_ampq_definition()
56 publisher_defn['inherit_id'] = True

Subscribers

People subscribed via source and target branches