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

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 101
Proposed branch: lp:~hopem/charms/trusty/glance/pki-token-support
Merge into: lp:~openstack-charmers-archive/charms/trusty/glance/next
Diff against target: 121 lines (+49/-11)
4 files modified
hooks/charmhelpers/contrib/openstack/context.py (+28/-9)
hooks/charmhelpers/contrib/openstack/templates/zeromq (+14/-0)
hooks/glance_utils.py (+6/-2)
templates/parts/keystone (+1/-0)
To merge this branch: bzr merge lp:~hopem/charms/trusty/glance/pki-token-support
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+250368@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2135 glance-next for hopem mp250368
    LINT OK: passed

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

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #1924 glance-next for hopem mp250368
    UNIT OK: passed

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

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #2043 glance-next for hopem mp250368
    AMULET OK: passed

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

101. By Edward Hope-Morley

synced /next

102. By Edward Hope-Morley

synced charm-helpers;

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2208 glance-next for hopem mp250368
    LINT OK: passed

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

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #1997 glance-next for hopem mp250368
    UNIT OK: passed

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

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #2154 glance-next for hopem mp250368
    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/10396503/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2154/

Revision history for this message
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:45:23 +0000
3+++ hooks/charmhelpers/contrib/openstack/context.py 2015-02-24 12:38:35 +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 12:38:35 +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/glance_utils.py'
86--- hooks/glance_utils.py 2015-01-08 10:02:48 +0000
87+++ hooks/glance_utils.py 2015-02-24 12:38:35 +0000
88@@ -76,7 +76,9 @@
89 (GLANCE_REGISTRY_CONF, {
90 'hook_contexts': [context.SharedDBContext(ssl_dir=GLANCE_CONF_DIR),
91 context.PostgresqlDBContext(),
92- context.IdentityServiceContext(),
93+ context.IdentityServiceContext(
94+ service='glance',
95+ service_user='glance'),
96 context.SyslogContext(),
97 glance_contexts.LoggingConfigContext(),
98 glance_contexts.GlanceIPv6Context(),
99@@ -90,7 +92,9 @@
100 'hook_contexts': [context.SharedDBContext(ssl_dir=GLANCE_CONF_DIR),
101 context.AMQPContext(ssl_dir=GLANCE_CONF_DIR),
102 context.PostgresqlDBContext(),
103- context.IdentityServiceContext(),
104+ context.IdentityServiceContext(
105+ service='glance',
106+ service_user='glance'),
107 glance_contexts.CephGlanceContext(),
108 glance_contexts.ObjectStoreContext(),
109 glance_contexts.HAProxyContext(),
110
111=== modified file 'templates/parts/keystone'
112--- templates/parts/keystone 2014-04-12 16:16:54 +0000
113+++ templates/parts/keystone 2015-02-24 12:38:35 +0000
114@@ -7,6 +7,7 @@
115 admin_tenant_name = {{ admin_tenant_name }}
116 admin_user = {{ admin_user }}
117 admin_password = {{ admin_password }}
118+signing_dir = {{ signing_dir }}
119
120 [paste_deploy]
121 flavor = keystone

Subscribers

People subscribed via source and target branches