Merge lp:~paulgear/charms/trusty/quantum-gateway/ethX-vlan-support into lp:~openstack-charmers/charms/trusty/quantum-gateway/next

Proposed by Paul Gear
Status: Rejected
Rejected by: Paul Gear
Proposed branch: lp:~paulgear/charms/trusty/quantum-gateway/ethX-vlan-support
Merge into: lp:~openstack-charmers/charms/trusty/quantum-gateway/next
Diff against target: 104 lines (+20/-9)
3 files modified
hooks/charmhelpers/contrib/network/ufw.py (+8/-3)
hooks/charmhelpers/core/host.py (+1/-1)
hooks/charmhelpers/core/sysctl.py (+11/-5)
To merge this branch: bzr merge lp:~paulgear/charms/trusty/quantum-gateway/ethX-vlan-support
Reviewer Review Type Date Requested Status
Liam Young (community) Disapprove
Review via email: mp+248326@code.launchpad.net

This proposal supersedes a proposal from 2015-02-03.

Description of the change

Just read https://wiki.ubuntu.com/ServerTeam/OpenStackCharms/ and realised this should be submitted against next rather than trunk.

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

charm_lint_check #1507 quantum-gateway-next for paulgear mp248326
    LINT OK: passed

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

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

charm_unit_test #1461 quantum-gateway-next for paulgear mp248326
    UNIT OK: passed

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

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

charm_amulet_test #1626 quantum-gateway-next for paulgear mp248326
    AMULET OK: passed

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

Revision history for this message
Liam Young (gnuoy) wrote :

Hi Paul, thanks for taking the time to submit the mp. I see a charmhelper sync sneaked in yesterday so this has, in effect, already landed.
Thanks
Liam

review: Disapprove
Revision history for this message
Paul Gear (paulgear) wrote :

Thanks Liam - do you want me to update the corresponding bug?

Unmerged revisions

86. By Paul Gear

Merge latest charm-helpers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/charmhelpers/contrib/network/ufw.py'
2--- hooks/charmhelpers/contrib/network/ufw.py 2015-01-23 11:08:26 +0000
3+++ hooks/charmhelpers/contrib/network/ufw.py 2015-02-03 00:34:10 +0000
4@@ -53,6 +53,7 @@
5 :returns: True if ufw is enabled
6 """
7 output = subprocess.check_output(['ufw', 'status'],
8+ universal_newlines=True,
9 env={'LANG': 'en_US',
10 'PATH': os.environ['PATH']})
11
12@@ -82,6 +83,7 @@
13 raise Exception("Couldn't disable IPv6 support in ufw")
14
15 output = subprocess.check_output(['ufw', 'enable'],
16+ universal_newlines=True,
17 env={'LANG': 'en_US',
18 'PATH': os.environ['PATH']})
19
20@@ -107,6 +109,7 @@
21 return True
22
23 output = subprocess.check_output(['ufw', 'disable'],
24+ universal_newlines=True,
25 env={'LANG': 'en_US',
26 'PATH': os.environ['PATH']})
27
28@@ -151,7 +154,7 @@
29 cmd += ['to', dst]
30
31 if port is not None:
32- cmd += ['port', port]
33+ cmd += ['port', str(port)]
34
35 if proto is not None:
36 cmd += ['proto', proto]
37@@ -208,9 +211,11 @@
38 :param action: `open` or `close`
39 """
40 if action == 'open':
41- subprocess.check_output(['ufw', 'allow', name])
42+ subprocess.check_output(['ufw', 'allow', str(name)],
43+ universal_newlines=True)
44 elif action == 'close':
45- subprocess.check_output(['ufw', 'delete', 'allow', name])
46+ subprocess.check_output(['ufw', 'delete', 'allow', str(name)],
47+ universal_newlines=True)
48 else:
49 raise Exception(("'{}' not supported, use 'allow' "
50 "or 'delete'").format(action))
51
52=== modified file 'hooks/charmhelpers/core/host.py'
53--- hooks/charmhelpers/core/host.py 2015-01-23 11:08:26 +0000
54+++ hooks/charmhelpers/core/host.py 2015-02-03 00:34:10 +0000
55@@ -361,7 +361,7 @@
56 ip_output = (line for line in ip_output if line)
57 for line in ip_output:
58 if line.split()[1].startswith(int_type):
59- matched = re.search('.*: (bond[0-9]+\.[0-9]+)@.*', line)
60+ matched = re.search('.*: (' + int_type + r'[0-9]+\.[0-9]+)@.*', line)
61 if matched:
62 interface = matched.groups()[0]
63 else:
64
65=== modified file 'hooks/charmhelpers/core/sysctl.py'
66--- hooks/charmhelpers/core/sysctl.py 2015-01-23 11:08:26 +0000
67+++ hooks/charmhelpers/core/sysctl.py 2015-02-03 00:34:10 +0000
68@@ -26,25 +26,31 @@
69 from charmhelpers.core.hookenv import (
70 log,
71 DEBUG,
72+ ERROR,
73 )
74
75
76 def create(sysctl_dict, sysctl_file):
77 """Creates a sysctl.conf file from a YAML associative array
78
79- :param sysctl_dict: a dict of sysctl options eg { 'kernel.max_pid': 1337 }
80- :type sysctl_dict: dict
81+ :param sysctl_dict: a YAML-formatted string of sysctl options eg "{ 'kernel.max_pid': 1337 }"
82+ :type sysctl_dict: str
83 :param sysctl_file: path to the sysctl file to be saved
84 :type sysctl_file: str or unicode
85 :returns: None
86 """
87- sysctl_dict = yaml.load(sysctl_dict)
88+ try:
89+ sysctl_dict_parsed = yaml.safe_load(sysctl_dict)
90+ except yaml.YAMLError:
91+ log("Error parsing YAML sysctl_dict: {}".format(sysctl_dict),
92+ level=ERROR)
93+ return
94
95 with open(sysctl_file, "w") as fd:
96- for key, value in sysctl_dict.items():
97+ for key, value in sysctl_dict_parsed.items():
98 fd.write("{}={}\n".format(key, value))
99
100- log("Updating sysctl_file: %s values: %s" % (sysctl_file, sysctl_dict),
101+ log("Updating sysctl_file: %s values: %s" % (sysctl_file, sysctl_dict_parsed),
102 level=DEBUG)
103
104 check_call(["sysctl", "-p", sysctl_file])

Subscribers

People subscribed via source and target branches