Merge lp:~james-page/charms/trusty/glance/stable-bug-1413862 into lp:~openstack-charmers-archive/charms/trusty/glance/trunk

Proposed by James Page
Status: Merged
Merged at revision: 97
Proposed branch: lp:~james-page/charms/trusty/glance/stable-bug-1413862
Merge into: lp:~openstack-charmers-archive/charms/trusty/glance/trunk
Diff against target: 73 lines (+14/-8)
4 files modified
charm-helpers-hooks.yaml (+1/-1)
charm-helpers-tests.yaml (+1/-1)
hooks/charmhelpers/contrib/openstack/context.py (+1/-1)
hooks/charmhelpers/core/sysctl.py (+11/-5)
To merge this branch: bzr merge lp:~james-page/charms/trusty/glance/stable-bug-1413862
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+251899@code.launchpad.net

Commit message

Resync helpers to resolve race condition when access-network is set in mysql or percona-cluster charms

Description of the change

Resync helpers to resolve race condition when access-network is set in mysql or percona-cluster charms

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2476 glance for james-page mp251899
    LINT OK: passed

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

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

charm_unit_test #2266 glance for james-page mp251899
    UNIT OK: passed

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

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

charm_amulet_test #2349 glance for james-page mp251899
    AMULET OK: passed

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

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 'charm-helpers-hooks.yaml'
2--- charm-helpers-hooks.yaml 2015-01-13 14:38:31 +0000
3+++ charm-helpers-hooks.yaml 2015-03-05 11:16:11 +0000
4@@ -1,4 +1,4 @@
5-branch: lp:charm-helpers
6+branch: lp:~openstack-charmers/charm-helpers/stable
7 destination: hooks/charmhelpers
8 include:
9 - core
10
11=== modified file 'charm-helpers-tests.yaml'
12--- charm-helpers-tests.yaml 2014-09-23 10:21:11 +0000
13+++ charm-helpers-tests.yaml 2015-03-05 11:16:11 +0000
14@@ -1,4 +1,4 @@
15-branch: lp:charm-helpers
16+branch: lp:~openstack-charmers/charm-helpers/stable
17 destination: tests/charmhelpers
18 include:
19 - contrib.amulet
20
21=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
22--- hooks/charmhelpers/contrib/openstack/context.py 2015-01-26 09:45:23 +0000
23+++ hooks/charmhelpers/contrib/openstack/context.py 2015-03-05 11:16:11 +0000
24@@ -191,7 +191,7 @@
25 unit=local_unit())
26 if set_hostname != access_hostname:
27 relation_set(relation_settings={hostname_key: access_hostname})
28- return ctxt # Defer any further hook execution for now....
29+ return None # Defer any further hook execution for now....
30
31 password_setting = 'password'
32 if self.relation_prefix:
33
34=== modified file 'hooks/charmhelpers/core/sysctl.py'
35--- hooks/charmhelpers/core/sysctl.py 2015-01-26 09:45:23 +0000
36+++ hooks/charmhelpers/core/sysctl.py 2015-03-05 11:16:11 +0000
37@@ -26,25 +26,31 @@
38 from charmhelpers.core.hookenv import (
39 log,
40 DEBUG,
41+ ERROR,
42 )
43
44
45 def create(sysctl_dict, sysctl_file):
46 """Creates a sysctl.conf file from a YAML associative array
47
48- :param sysctl_dict: a dict of sysctl options eg { 'kernel.max_pid': 1337 }
49- :type sysctl_dict: dict
50+ :param sysctl_dict: a YAML-formatted string of sysctl options eg "{ 'kernel.max_pid': 1337 }"
51+ :type sysctl_dict: str
52 :param sysctl_file: path to the sysctl file to be saved
53 :type sysctl_file: str or unicode
54 :returns: None
55 """
56- sysctl_dict = yaml.load(sysctl_dict)
57+ try:
58+ sysctl_dict_parsed = yaml.safe_load(sysctl_dict)
59+ except yaml.YAMLError:
60+ log("Error parsing YAML sysctl_dict: {}".format(sysctl_dict),
61+ level=ERROR)
62+ return
63
64 with open(sysctl_file, "w") as fd:
65- for key, value in sysctl_dict.items():
66+ for key, value in sysctl_dict_parsed.items():
67 fd.write("{}={}\n".format(key, value))
68
69- log("Updating sysctl_file: %s values: %s" % (sysctl_file, sysctl_dict),
70+ log("Updating sysctl_file: %s values: %s" % (sysctl_file, sysctl_dict_parsed),
71 level=DEBUG)
72
73 check_call(["sysctl", "-p", sysctl_file])

Subscribers

People subscribed via source and target branches