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
=== modified file 'charm-helpers-hooks.yaml'
--- charm-helpers-hooks.yaml 2015-01-13 14:38:31 +0000
+++ charm-helpers-hooks.yaml 2015-03-05 11:16:11 +0000
@@ -1,4 +1,4 @@
1branch: lp:charm-helpers1branch: lp:~openstack-charmers/charm-helpers/stable
2destination: hooks/charmhelpers2destination: hooks/charmhelpers
3include:3include:
4 - core4 - core
55
=== modified file 'charm-helpers-tests.yaml'
--- charm-helpers-tests.yaml 2014-09-23 10:21:11 +0000
+++ charm-helpers-tests.yaml 2015-03-05 11:16:11 +0000
@@ -1,4 +1,4 @@
1branch: lp:charm-helpers1branch: lp:~openstack-charmers/charm-helpers/stable
2destination: tests/charmhelpers2destination: tests/charmhelpers
3include:3include:
4 - contrib.amulet4 - contrib.amulet
55
=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
--- hooks/charmhelpers/contrib/openstack/context.py 2015-01-26 09:45:23 +0000
+++ hooks/charmhelpers/contrib/openstack/context.py 2015-03-05 11:16:11 +0000
@@ -191,7 +191,7 @@
191 unit=local_unit())191 unit=local_unit())
192 if set_hostname != access_hostname:192 if set_hostname != access_hostname:
193 relation_set(relation_settings={hostname_key: access_hostname})193 relation_set(relation_settings={hostname_key: access_hostname})
194 return ctxt # Defer any further hook execution for now....194 return None # Defer any further hook execution for now....
195195
196 password_setting = 'password'196 password_setting = 'password'
197 if self.relation_prefix:197 if self.relation_prefix:
198198
=== modified file 'hooks/charmhelpers/core/sysctl.py'
--- hooks/charmhelpers/core/sysctl.py 2015-01-26 09:45:23 +0000
+++ hooks/charmhelpers/core/sysctl.py 2015-03-05 11:16:11 +0000
@@ -26,25 +26,31 @@
26from charmhelpers.core.hookenv import (26from charmhelpers.core.hookenv import (
27 log,27 log,
28 DEBUG,28 DEBUG,
29 ERROR,
29)30)
3031
3132
32def create(sysctl_dict, sysctl_file):33def create(sysctl_dict, sysctl_file):
33 """Creates a sysctl.conf file from a YAML associative array34 """Creates a sysctl.conf file from a YAML associative array
3435
35 :param sysctl_dict: a dict of sysctl options eg { 'kernel.max_pid': 1337 }36 :param sysctl_dict: a YAML-formatted string of sysctl options eg "{ 'kernel.max_pid': 1337 }"
36 :type sysctl_dict: dict37 :type sysctl_dict: str
37 :param sysctl_file: path to the sysctl file to be saved38 :param sysctl_file: path to the sysctl file to be saved
38 :type sysctl_file: str or unicode39 :type sysctl_file: str or unicode
39 :returns: None40 :returns: None
40 """41 """
41 sysctl_dict = yaml.load(sysctl_dict)42 try:
43 sysctl_dict_parsed = yaml.safe_load(sysctl_dict)
44 except yaml.YAMLError:
45 log("Error parsing YAML sysctl_dict: {}".format(sysctl_dict),
46 level=ERROR)
47 return
4248
43 with open(sysctl_file, "w") as fd:49 with open(sysctl_file, "w") as fd:
44 for key, value in sysctl_dict.items():50 for key, value in sysctl_dict_parsed.items():
45 fd.write("{}={}\n".format(key, value))51 fd.write("{}={}\n".format(key, value))
4652
47 log("Updating sysctl_file: %s values: %s" % (sysctl_file, sysctl_dict),53 log("Updating sysctl_file: %s values: %s" % (sysctl_file, sysctl_dict_parsed),
48 level=DEBUG)54 level=DEBUG)
4955
50 check_call(["sysctl", "-p", sysctl_file])56 check_call(["sysctl", "-p", sysctl_file])

Subscribers

People subscribed via source and target branches