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

Proposed by James Page
Status: Merged
Merged at revision: 74
Proposed branch: lp:~james-page/charms/trusty/neutron-api/stable-bug-1413862
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-api/trunk
Diff against target: 63 lines (+13/-7)
3 files modified
charm-helpers-sync.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/neutron-api/stable-bug-1413862
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+251901@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 #2478 neutron-api for james-page mp251901
    LINT OK: passed

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

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

charm_unit_test #2268 neutron-api for james-page mp251901
    UNIT OK: passed

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

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

charm_amulet_test #2351 neutron-api for james-page mp251901
    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/10538300/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2351/

Preview Diff

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

Subscribers

People subscribed via source and target branches