Merge lp:~hopem/charms/trusty/cinder/pki-token-support into lp:~openstack-charmers-archive/charms/trusty/cinder/next

Proposed by Edward Hope-Morley on 2015-02-18
Status: Merged
Merged at revision: 77
Proposed branch: lp:~hopem/charms/trusty/cinder/pki-token-support
Merge into: lp:~openstack-charmers-archive/charms/trusty/cinder/next
Diff against target: 123 lines (+48/-11)
5 files modified
hooks/charmhelpers/contrib/openstack/context.py (+28/-9)
hooks/charmhelpers/contrib/openstack/templates/zeromq (+14/-0)
hooks/cinder_hooks.py (+1/-0)
hooks/cinder_utils.py (+3/-1)
templates/icehouse/cinder.conf (+2/-1)
To merge this branch: bzr merge lp:~hopem/charms/trusty/cinder/pki-token-support
Reviewer Review Type Date Requested Status
Liam Young 2015-02-18 Approve on 2015-03-11
Review via email: mp+250170@code.launchpad.net
To post a comment you must log in.

charm_lint_check #2134 cinder-next for hopem mp250170
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/2134/

charm_unit_test #1923 cinder-next for hopem mp250170
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/1923/

charm_amulet_test #2042 cinder-next for hopem mp250170
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/2042/

75. By Edward Hope-Morley on 2015-02-24

synced /next

76. By Edward Hope-Morley on 2015-02-24

synced charm-helpers;

77. By Edward Hope-Morley on 2015-02-24

ensure apache2 stop+start if config changed

charm_lint_check #2207 cinder-next for hopem mp250170
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/2207/

charm_unit_test #1996 cinder-next for hopem mp250170
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/1996/

charm_amulet_test #2153 cinder-next for hopem mp250170
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
  ERROR subprocess encountered error code 1
  make: *** [test] Error 1

Full amulet test output: http://paste.ubuntu.com/10396306/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2153/

Liam Young (gnuoy) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
2--- hooks/charmhelpers/contrib/openstack/context.py 2015-01-26 09:47:37 +0000
3+++ hooks/charmhelpers/contrib/openstack/context.py 2015-02-24 14:13:55 +0000
4@@ -279,9 +279,25 @@
5 class IdentityServiceContext(OSContextGenerator):
6 interfaces = ['identity-service']
7
8+ def __init__(self, service=None, service_user=None):
9+ self.service = service
10+ self.service_user = service_user
11+
12 def __call__(self):
13 log('Generating template context for identity-service', level=DEBUG)
14 ctxt = {}
15+
16+ if self.service and self.service_user:
17+ # This is required for pki token signing if we don't want /tmp to
18+ # be used.
19+ cachedir = '/var/cache/%s' % (self.service)
20+ if not os.path.isdir(cachedir):
21+ log("Creating service cache dir %s" % (cachedir), level=DEBUG)
22+ mkdir(path=cachedir, owner=self.service_user,
23+ group=self.service_user, perms=0o700)
24+
25+ ctxt['signing_dir'] = cachedir
26+
27 for rid in relation_ids('identity-service'):
28 for unit in related_units(rid):
29 rdata = relation_get(rid=rid, unit=unit)
30@@ -291,15 +307,16 @@
31 auth_host = format_ipv6_addr(auth_host) or auth_host
32 svc_protocol = rdata.get('service_protocol') or 'http'
33 auth_protocol = rdata.get('auth_protocol') or 'http'
34- ctxt = {'service_port': rdata.get('service_port'),
35- 'service_host': serv_host,
36- 'auth_host': auth_host,
37- 'auth_port': rdata.get('auth_port'),
38- 'admin_tenant_name': rdata.get('service_tenant'),
39- 'admin_user': rdata.get('service_username'),
40- 'admin_password': rdata.get('service_password'),
41- 'service_protocol': svc_protocol,
42- 'auth_protocol': auth_protocol}
43+ ctxt.update({'service_port': rdata.get('service_port'),
44+ 'service_host': serv_host,
45+ 'auth_host': auth_host,
46+ 'auth_port': rdata.get('auth_port'),
47+ 'admin_tenant_name': rdata.get('service_tenant'),
48+ 'admin_user': rdata.get('service_username'),
49+ 'admin_password': rdata.get('service_password'),
50+ 'service_protocol': svc_protocol,
51+ 'auth_protocol': auth_protocol})
52+
53 if context_complete(ctxt):
54 # NOTE(jamespage) this is required for >= icehouse
55 # so a missing value just indicates keystone needs
56@@ -1021,6 +1038,8 @@
57 for unit in related_units(rid):
58 ctxt['zmq_nonce'] = relation_get('nonce', unit, rid)
59 ctxt['zmq_host'] = relation_get('host', unit, rid)
60+ ctxt['zmq_redis_address'] = relation_get(
61+ 'zmq_redis_address', unit, rid)
62
63 return ctxt
64
65
66=== added file 'hooks/charmhelpers/contrib/openstack/templates/zeromq'
67--- hooks/charmhelpers/contrib/openstack/templates/zeromq 1970-01-01 00:00:00 +0000
68+++ hooks/charmhelpers/contrib/openstack/templates/zeromq 2015-02-24 14:13:55 +0000
69@@ -0,0 +1,14 @@
70+{% if zmq_host -%}
71+# ZeroMQ configuration (restart-nonce: {{ zmq_nonce }})
72+rpc_backend = zmq
73+rpc_zmq_host = {{ zmq_host }}
74+{% if zmq_redis_address -%}
75+rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_redis.MatchMakerRedis
76+matchmaker_heartbeat_freq = 15
77+matchmaker_heartbeat_ttl = 30
78+[matchmaker_redis]
79+host = {{ zmq_redis_address }}
80+{% else -%}
81+rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_ring.MatchMakerRing
82+{% endif -%}
83+{% endif -%}
84
85=== modified file 'hooks/cinder_hooks.py'
86--- hooks/cinder_hooks.py 2015-02-04 19:29:31 +0000
87+++ hooks/cinder_hooks.py 2015-02-24 14:13:55 +0000
88@@ -417,6 +417,7 @@
89 CONFIGS.write_all()
90
91
92+@restart_on_change(restart_map(), stopstart=True)
93 def configure_https():
94 '''Enables SSL API Apache config if appropriate and kicks identity-service
95 with any required api updates.
96
97=== modified file 'hooks/cinder_utils.py'
98--- hooks/cinder_utils.py 2014-12-15 10:17:11 +0000
99+++ hooks/cinder_utils.py 2015-02-24 14:13:55 +0000
100@@ -125,7 +125,9 @@
101 config_file=CINDER_CONF),
102 cinder_contexts.StorageBackendContext(),
103 cinder_contexts.LoggingConfigContext(),
104- context.IdentityServiceContext(),
105+ context.IdentityServiceContext(
106+ service='cinder',
107+ service_user='cinder'),
108 context.BindHostContext(),
109 context.WorkerConfigContext()],
110 'services': ['cinder-api', 'cinder-volume',
111
112=== modified file 'templates/icehouse/cinder.conf'
113--- templates/icehouse/cinder.conf 2014-10-07 12:27:23 +0000
114+++ templates/icehouse/cinder.conf 2015-02-24 14:13:55 +0000
115@@ -65,6 +65,7 @@
116 admin_tenant_name = {{ admin_tenant_name }}
117 admin_user = {{ admin_user }}
118 admin_password = {{ admin_password }}
119-{% endif -%}
120+signing_dir = {{ signing_dir }}
121+{% endif %}
122
123 {% include "parts/section-database" %}

Subscribers

People subscribed via source and target branches