Merge lp:~ivoks/charms/trusty/contrail-configuration/cassandra-authentication into lp:~sdn-charmers/charms/trusty/contrail-configuration/trunk

Proposed by Ante Karamatić
Status: Merged
Merged at revision: 66
Proposed branch: lp:~ivoks/charms/trusty/contrail-configuration/cassandra-authentication
Merge into: lp:~sdn-charmers/charms/trusty/contrail-configuration/trunk
Diff against target: 81 lines (+28/-3)
6 files modified
hooks/contrail_configuration_utils.py (+13/-3)
templates/contrail-api.conf (+3/-0)
templates/contrail-device-manager.conf (+3/-0)
templates/contrail-schema.conf (+3/-0)
templates/contrail-svc-monitor.conf (+3/-0)
templates/discovery.conf (+3/-0)
To merge this branch: bzr merge lp:~ivoks/charms/trusty/contrail-configuration/cassandra-authentication
Reviewer Review Type Date Requested Status
Robert Ayres (community) Approve
Review via email: mp+320472@code.launchpad.net

Description of the change

Currently Contrail charms require cassandra to run in unrestricted mode, allowing every user access to all of the data. With this change configuration can use password authentication in Cassandra.

To post a comment you must log in.
Revision history for this message
Robert Ayres (robert-ayres) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/contrail_configuration_utils.py'
2--- hooks/contrail_configuration_utils.py 2017-03-10 12:49:07 +0000
3+++ hooks/contrail_configuration_utils.py 2017-03-21 10:08:54 +0000
4@@ -136,9 +136,19 @@
5 relation_get("rpc_port", unit, rid),
6 relation_get("port", unit, rid))
7 for unit in related_units(rid))
8- if rpc_port or port ] \
9- if config.get("cassandra-ready") else []
10- return { "cassandra_servers": servers }
11+ if rpc_port or port ]
12+ ctxs = [ { "cassandra_servers": servers,
13+ "cassandra_username": username,
14+ "cassandra_password": password,
15+ }
16+ for rid in relation_ids("cassandra")
17+ for unit, username, password in
18+ ((unit,
19+ relation_get("username", unit, rid),
20+ relation_get("password", unit, rid))
21+ for unit in related_units(rid))]
22+ return ctxs[0] if ctxs else {}
23+
24
25 def cassandra_units():
26 """Return a list of cassandra units"""
27
28=== modified file 'templates/contrail-api.conf'
29--- templates/contrail-api.conf 2017-01-31 12:51:09 +0000
30+++ templates/contrail-api.conf 2017-03-21 10:08:54 +0000
31@@ -28,3 +28,6 @@
32 admin_token =
33 admin_tenant_name = {{ admin_tenant_name }}
34
35+[CASSANDRA]
36+cassandra_user = {{ cassandra_username }}
37+cassandra_password = {{ cassandra_password }}
38
39=== modified file 'templates/contrail-device-manager.conf'
40--- templates/contrail-device-manager.conf 2016-04-23 02:01:49 +0000
41+++ templates/contrail-device-manager.conf 2017-03-21 10:08:54 +0000
42@@ -23,3 +23,6 @@
43 admin_password = {{ admin_password }}
44 admin_tenant_name = {{ admin_tenant_name }}
45
46+[CASSANDRA]
47+cassandra_user = {{ cassandra_username }}
48+cassandra_password = {{ cassandra_password }}
49
50=== modified file 'templates/contrail-schema.conf'
51--- templates/contrail-schema.conf 2016-04-19 21:10:36 +0000
52+++ templates/contrail-schema.conf 2017-03-21 10:08:54 +0000
53@@ -22,3 +22,6 @@
54 admin_password = {{ admin_password }}
55 admin_tenant_name = {{ admin_tenant_name }}
56
57+[CASSANDRA]
58+cassandra_user = {{ cassandra_username }}
59+cassandra_password = {{ cassandra_password }}
60
61=== modified file 'templates/contrail-svc-monitor.conf'
62--- templates/contrail-svc-monitor.conf 2016-04-19 21:10:36 +0000
63+++ templates/contrail-svc-monitor.conf 2017-03-21 10:08:54 +0000
64@@ -33,3 +33,6 @@
65 analytics_server_ip = {{ analytics_server_ip }}
66 analytics_server_port = {{ analytics_server_port }}
67
68+[CASSANDRA]
69+cassandra_user = {{ cassandra_username }}
70+cassandra_password = {{ cassandra_password }}
71
72=== modified file 'templates/discovery.conf'
73--- templates/discovery.conf 2015-06-01 19:32:33 +0000
74+++ templates/discovery.conf 2017-03-21 10:08:54 +0000
75@@ -16,3 +16,6 @@
76 hc_max_miss = 3
77 ttl_short = 1
78
79+[CASSANDRA]
80+cassandra_user = {{ cassandra_username }}
81+cassandra_password = {{ cassandra_password }}

Subscribers

People subscribed via source and target branches