Merge lp:~gnuoy/charms/trusty/nova-compute/subctxt-fix into lp:~openstack-charmers-archive/charms/trusty/nova-compute/next

Proposed by Liam Young
Status: Merged
Merged at revision: 148
Proposed branch: lp:~gnuoy/charms/trusty/nova-compute/subctxt-fix
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-compute/next
Diff against target: 93 lines (+32/-32)
2 files modified
hooks/charmhelpers/contrib/openstack/context.py (+30/-26)
hooks/nova_compute_utils.py (+2/-6)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/nova-compute/subctxt-fix
Reviewer Review Type Date Requested Status
Billy Olsen Approve
Review via email: mp+266262@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 #7181 nova-compute-next for gnuoy mp266262
    LINT OK: passed

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

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

charm_unit_test #6645 nova-compute-next for gnuoy mp266262
    UNIT OK: passed

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

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

charm_amulet_test #5467 nova-compute-next for gnuoy mp266262
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

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

Revision history for this message
Ryan Beisner (1chb1n) wrote :

FYI:
The test rig is on hold due to undercloud system issues. I don't anticipate having automated amulet results ahead of the 15.07 charm cut date.

Revision history for this message
Billy Olsen (billy-olsen) wrote :

Environment running amulet test is unreliable ATM, thus the failure...

LGTM, Approved.

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-07-29 10:48:58 +0000
3+++ hooks/charmhelpers/contrib/openstack/context.py 2015-07-29 16:12:20 +0000
4@@ -1051,8 +1051,11 @@
5 :param config_file : Service's config file to query sections
6 :param interface : Subordinate interface to inspect
7 """
8- self.service = service
9 self.config_file = config_file
10+ if isinstance(service, list):
11+ self.services = service
12+ else:
13+ self.services = [service]
14 if isinstance(interface, list):
15 self.interfaces = interface
16 else:
17@@ -1075,31 +1078,32 @@
18 'setting from %s' % rid, level=ERROR)
19 continue
20
21- if self.service not in sub_config:
22- log('Found subordinate_config on %s but it contained'
23- 'nothing for %s service' % (rid, self.service),
24- level=INFO)
25- continue
26-
27- sub_config = sub_config[self.service]
28- if self.config_file not in sub_config:
29- log('Found subordinate_config on %s but it contained'
30- 'nothing for %s' % (rid, self.config_file),
31- level=INFO)
32- continue
33-
34- sub_config = sub_config[self.config_file]
35- for k, v in six.iteritems(sub_config):
36- if k == 'sections':
37- for section, config_list in six.iteritems(v):
38- log("adding section '%s'" % (section),
39- level=DEBUG)
40- if ctxt[k].get(section):
41- ctxt[k][section].extend(config_list)
42- else:
43- ctxt[k][section] = config_list
44- else:
45- ctxt[k] = v
46+ for service in self.services:
47+ if service not in sub_config:
48+ log('Found subordinate_config on %s but it contained'
49+ 'nothing for %s service' % (rid, service),
50+ level=INFO)
51+ continue
52+
53+ sub_config = sub_config[service]
54+ if self.config_file not in sub_config:
55+ log('Found subordinate_config on %s but it contained'
56+ 'nothing for %s' % (rid, self.config_file),
57+ level=INFO)
58+ continue
59+
60+ sub_config = sub_config[self.config_file]
61+ for k, v in six.iteritems(sub_config):
62+ if k == 'sections':
63+ for section, config_list in six.iteritems(v):
64+ log("adding section '%s'" % (section),
65+ level=DEBUG)
66+ if ctxt[k].get(section):
67+ ctxt[k][section].extend(config_list)
68+ else:
69+ ctxt[k][section] = config_list
70+ else:
71+ ctxt[k] = v
72 log("%d section(s) found" % (len(ctxt['sections'])), level=DEBUG)
73 return ctxt
74
75
76=== modified file 'hooks/nova_compute_utils.py'
77--- hooks/nova_compute_utils.py 2015-07-14 11:11:25 +0000
78+++ hooks/nova_compute_utils.py 2015-07-29 16:12:20 +0000
79@@ -155,12 +155,8 @@
80 NovaComputeCephContext(),
81 context.SyslogContext(),
82 context.SubordinateConfigContext(
83- interface='nova-ceilometer',
84- service='nova',
85- config_file=NOVA_CONF),
86- context.SubordinateConfigContext(
87- interface='neutron-plugin',
88- service='nova-compute',
89+ interface=['neutron-plugin', 'nova-ceilometer'],
90+ service=['nova-compute', 'nova'],
91 config_file=NOVA_CONF),
92 InstanceConsoleContext(),
93 context.ZeroMQContext(),

Subscribers

People subscribed via source and target branches