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

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 72
Proposed branch: lp:~hopem/charms/trusty/ceilometer/pki-token-support
Merge into: lp:~openstack-charmers-archive/charms/trusty/ceilometer/next
Diff against target: 204 lines (+61/-14) (has conflicts)
6 files modified
hooks/ceilometer_contexts.py (+4/-4)
hooks/ceilometer_hooks.py (+29/-4)
hooks/ceilometer_utils.py (+4/-3)
hooks/charmhelpers/contrib/openstack/templates/zeromq (+14/-0)
templates/icehouse/ceilometer.conf (+9/-3)
unit_tests/test_ceilometer_hooks.py (+1/-0)
Conflict adding file hooks/charmhelpers/contrib/openstack/templates/zeromq.  Moved existing file to hooks/charmhelpers/contrib/openstack/templates/zeromq.moved.
To merge this branch: bzr merge lp:~hopem/charms/trusty/ceilometer/pki-token-support
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+250373@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 #2138 ceilometer-next for hopem mp250373
    LINT OK: passed

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

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

charm_unit_test #1927 ceilometer-next for hopem mp250373
    UNIT OK: passed

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

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

charm_amulet_test #2046 ceilometer-next for hopem mp250373
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

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

76. By Edward Hope-Morley

synced /next

77. By Edward Hope-Morley

synced charm-helpers;

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

charm_lint_check #2211 ceilometer-next for hopem mp250373
    LINT OK: passed

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

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

charm_unit_test #2000 ceilometer-next for hopem mp250373
    UNIT OK: passed

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

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

charm_amulet_test #2157 ceilometer-next for hopem mp250373
    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/10396518/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2157/

78. By Edward Hope-Morley

ensure endpoints updated in keystone changed

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

charm_lint_check #2473 ceilometer-next for hopem mp250373
    LINT OK: passed

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

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

charm_unit_test #2263 ceilometer-next for hopem mp250373
    UNIT OK: passed

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

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

charm_amulet_test #2346 ceilometer-next for hopem mp250373
    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/10535888/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2346/

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/ceilometer_contexts.py'
2--- hooks/ceilometer_contexts.py 2014-12-03 23:23:51 +0000
3+++ hooks/ceilometer_contexts.py 2015-03-05 06:08:49 +0000
4@@ -104,8 +104,9 @@
5 specific to this charm.
6 '''
7 haproxy_port = CEILOMETER_PORT
8- api_port = determine_api_port(CEILOMETER_PORT)
9- apache_port = determine_apache_port(CEILOMETER_PORT)
10+ api_port = determine_api_port(CEILOMETER_PORT, singlenode_mode=True)
11+ apache_port = determine_apache_port(CEILOMETER_PORT,
12+ singlenode_mode=True)
13
14 ctxt = {
15 'service_ports': {'ceilometer_api': [haproxy_port, apache_port]},
16@@ -116,6 +117,5 @@
17
18 class ApacheSSLContext(SSLContext):
19
20+ external_ports = [CEILOMETER_PORT]
21 service_namespace = "ceilometer"
22-
23- external_ports = [CEILOMETER_PORT+100]
24
25=== modified file 'hooks/ceilometer_hooks.py'
26--- hooks/ceilometer_hooks.py 2015-02-19 01:55:28 +0000
27+++ hooks/ceilometer_hooks.py 2015-03-05 06:08:49 +0000
28@@ -1,9 +1,10 @@
29 #!/usr/bin/python
30-
31 import base64
32 import shutil
33+import subprocess
34 import sys
35 import os
36+
37 from charmhelpers.fetch import (
38 apt_install, filter_installed_packages,
39 apt_update
40@@ -38,7 +39,7 @@
41 get_ceilometer_context,
42 get_shared_secret,
43 do_openstack_upgrade,
44- set_shared_secret
45+ set_shared_secret,
46 )
47 from ceilometer_contexts import CEILOMETER_PORT
48 from charmhelpers.contrib.openstack.ip import (
49@@ -85,14 +86,22 @@
50
51 @hooks.hook("amqp-relation-changed",
52 "shared-db-relation-changed",
53- "shared-db-relation-departed",
54- "identity-service-relation-changed")
55+ "shared-db-relation-departed")
56 @restart_on_change(restart_map())
57 def any_changed():
58 CONFIGS.write_all()
59+ configure_https()
60 ceilometer_joined()
61
62
63+@hooks.hook("identity-service-relation-changed")
64+@restart_on_change(restart_map())
65+def identity_service_relation_changed():
66+ CONFIGS.write_all()
67+ configure_https()
68+ keystone_joined()
69+
70+
71 @hooks.hook("amqp-relation-departed")
72 @restart_on_change(restart_map())
73 def amqp_departed():
74@@ -102,6 +111,21 @@
75 CONFIGS.write_all()
76
77
78+def configure_https():
79+ """Enables SSL API Apache config if appropriate."""
80+ # need to write all to ensure changes to the entire request pipeline
81+ # propagate (c-api, haprxy, apache)
82+ CONFIGS.write_all()
83+ if 'https' in CONFIGS.complete_contexts():
84+ cmd = ['a2ensite', 'openstack_https_frontend']
85+ subprocess.check_call(cmd)
86+ else:
87+ cmd = ['a2dissite', 'openstack_https_frontend']
88+ subprocess.check_call(cmd)
89+
90+ subprocess.check_call(['service', 'apache2', 'reload'])
91+
92+
93 @hooks.hook('config-changed')
94 @restart_on_change(restart_map())
95 def config_changed():
96@@ -110,6 +134,7 @@
97 update_nrpe_config()
98 CONFIGS.write_all()
99 ceilometer_joined()
100+ configure_https()
101 for rid in relation_ids('identity-service'):
102 keystone_joined(relid=rid)
103
104
105=== modified file 'hooks/ceilometer_utils.py'
106--- hooks/ceilometer_utils.py 2015-01-09 16:27:03 +0000
107+++ hooks/ceilometer_utils.py 2015-03-05 06:08:49 +0000
108@@ -65,11 +65,12 @@
109 ]
110
111 CEILOMETER_ROLE = "ResellerAdmin"
112-
113+SVC = 'ceilometer'
114
115 CONFIG_FILES = OrderedDict([
116 (CEILOMETER_CONF, {
117- 'hook_contexts': [context.IdentityServiceContext(),
118+ 'hook_contexts': [context.IdentityServiceContext(service=SVC,
119+ service_user=SVC),
120 context.AMQPContext(ssl_dir=CEILOMETER_CONF_DIR),
121 LoggingConfigContext(),
122 MongoDBContext(),
123@@ -79,7 +80,7 @@
124 'services': CEILOMETER_SERVICES
125 }),
126 (HAPROXY_CONF, {
127- 'hook_contexts': [context.HAProxyContext(),
128+ 'hook_contexts': [context.HAProxyContext(singlenode_mode=True),
129 HAProxyContext()],
130 'services': ['haproxy'],
131 }),
132
133=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
134=== added file 'hooks/charmhelpers/contrib/openstack/templates/zeromq'
135--- hooks/charmhelpers/contrib/openstack/templates/zeromq 1970-01-01 00:00:00 +0000
136+++ hooks/charmhelpers/contrib/openstack/templates/zeromq 2015-03-05 06:08:49 +0000
137@@ -0,0 +1,14 @@
138+{% if zmq_host -%}
139+# ZeroMQ configuration (restart-nonce: {{ zmq_nonce }})
140+rpc_backend = zmq
141+rpc_zmq_host = {{ zmq_host }}
142+{% if zmq_redis_address -%}
143+rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_redis.MatchMakerRedis
144+matchmaker_heartbeat_freq = 15
145+matchmaker_heartbeat_ttl = 30
146+[matchmaker_redis]
147+host = {{ zmq_redis_address }}
148+{% else -%}
149+rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_ring.MatchMakerRing
150+{% endif -%}
151+{% endif -%}
152
153=== renamed file 'hooks/charmhelpers/contrib/openstack/templates/zeromq' => 'hooks/charmhelpers/contrib/openstack/templates/zeromq.moved'
154=== modified file 'templates/icehouse/ceilometer.conf'
155--- templates/icehouse/ceilometer.conf 2014-11-12 23:42:57 +0000
156+++ templates/icehouse/ceilometer.conf 2015-03-05 06:08:49 +0000
157@@ -8,23 +8,29 @@
158 debug = {{ debug }}
159 verbose = {{ verbose }}
160 use_syslog = {{ use_syslog }}
161-{% include "parts/rabbitmq" %}
162+
163+{% include "parts/rabbitmq" -%}
164+
165 [api]
166 port = {{ port }}
167+
168 [service_credentials]
169 os_auth_url = {{ service_protocol }}://{{ service_host }}:{{ service_port }}/v2.0
170 os_tenant_name = {{ admin_tenant_name }}
171 os_username = {{ admin_user }}
172 os_password = {{ admin_password }}
173+
174 [database]
175 {% if db_replset: -%}
176 connection = mongodb://{{ db_mongo_servers }}/{{ db_name }}?readPreference=primaryPreferred&replicaSet={{ db_replset }}
177 mongodb_replica_set = {{ db_replset }}
178 {% else -%}
179 connection = mongodb://{{ db_host }}:{{ db_port }}/{{ db_name }}
180-{% endif -%}
181+{% endif %}
182+
183 [publisher_rpc]
184 metering_secret = {{ metering_secret }}
185+
186 [keystone_authtoken]
187 auth_uri = {{ service_protocol }}://{{ service_host }}:{{ service_port }}/
188 auth_host = {{ auth_host }}
189@@ -33,4 +39,4 @@
190 admin_tenant_name = {{ admin_tenant_name }}
191 admin_user = {{ admin_user }}
192 admin_password = {{ admin_password }}
193-
194+signing_dir = {{ signing_dir }}
195
196=== modified file 'unit_tests/test_ceilometer_hooks.py'
197--- unit_tests/test_ceilometer_hooks.py 2015-01-09 16:28:11 +0000
198+++ unit_tests/test_ceilometer_hooks.py 2015-03-05 06:08:49 +0000
199@@ -33,6 +33,7 @@
200 'canonical_url',
201 'service_restart',
202 'update_nrpe_config',
203+ 'configure_https',
204 ]
205
206

Subscribers

People subscribed via source and target branches