Merge lp:~gnuoy/charms/trusty/neutron-openvswitch/1421215 into lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next
- Trusty Tahr (14.04)
- 1421215
- Merge into next
Status: | Merged |
---|---|
Merged at revision: | 44 |
Proposed branch: | lp:~gnuoy/charms/trusty/neutron-openvswitch/1421215 |
Merge into: | lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next |
Diff against target: |
252 lines (+70/-27) 10 files modified
hooks/charmhelpers/contrib/openstack/amulet/deployment.py (+5/-2) hooks/charmhelpers/contrib/python/packages.py (+2/-2) hooks/charmhelpers/core/fstab.py (+2/-2) hooks/charmhelpers/core/strutils.py (+38/-0) hooks/charmhelpers/core/sysctl.py (+2/-2) hooks/charmhelpers/core/unitdata.py (+1/-1) hooks/charmhelpers/fetch/archiveurl.py (+10/-10) hooks/charmhelpers/fetch/giturl.py (+1/-1) hooks/neutron_ovs_context.py (+5/-3) unit_tests/test_neutron_ovs_context.py (+4/-4) |
To merge this branch: | bzr merge lp:~gnuoy/charms/trusty/neutron-openvswitch/1421215 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Edward Hope-Morley | Approve | ||
Review via email: mp+249535@code.launchpad.net |
Commit message
Description of the change
uosci-testing-bot (uosci-testing-bot) wrote : | # |
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #1744 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #1895 neutron-
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://
Build: http://
- 45. By Liam Young
-
Fix lint
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #1957 neutron-
LINT FAIL: lint-test failed
LINT Results (max last 2 lines):
hooks/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #1747 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #1898 neutron-
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://
Build: http://
- 46. By Liam Young
-
Try to fix lint error that osci is seeing although I cannot reproduce locally
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #1970 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #1760 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #1909 neutron-
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://
Build: http://
Edward Hope-Morley (hopem) wrote : | # |
Lets start using common code for tasks like this -https:/
Edward Hope-Morley (hopem) : | # |
- 47. By Liam Young
-
Use charmhelper bool_from_string rather than local to_boolean
Preview Diff
1 | === modified file 'hooks/charmhelpers/contrib/openstack/amulet/deployment.py' | |||
2 | --- hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2015-01-26 09:42:44 +0000 | |||
3 | +++ hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2015-02-16 11:16:24 +0000 | |||
4 | @@ -71,16 +71,19 @@ | |||
5 | 71 | services.append(this_service) | 71 | services.append(this_service) |
6 | 72 | use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', | 72 | use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', |
7 | 73 | 'ceph-osd', 'ceph-radosgw'] | 73 | 'ceph-osd', 'ceph-radosgw'] |
8 | 74 | # Openstack subordinate charms do not expose an origin option as that | ||
9 | 75 | # is controlled by the principle | ||
10 | 76 | ignore = ['neutron-openvswitch'] | ||
11 | 74 | 77 | ||
12 | 75 | if self.openstack: | 78 | if self.openstack: |
13 | 76 | for svc in services: | 79 | for svc in services: |
15 | 77 | if svc['name'] not in use_source: | 80 | if svc['name'] not in use_source + ignore: |
16 | 78 | config = {'openstack-origin': self.openstack} | 81 | config = {'openstack-origin': self.openstack} |
17 | 79 | self.d.configure(svc['name'], config) | 82 | self.d.configure(svc['name'], config) |
18 | 80 | 83 | ||
19 | 81 | if self.source: | 84 | if self.source: |
20 | 82 | for svc in services: | 85 | for svc in services: |
22 | 83 | if svc['name'] in use_source: | 86 | if svc['name'] in use_source and svc['name'] not in ignore: |
23 | 84 | config = {'source': self.source} | 87 | config = {'source': self.source} |
24 | 85 | self.d.configure(svc['name'], config) | 88 | self.d.configure(svc['name'], config) |
25 | 86 | 89 | ||
26 | 87 | 90 | ||
27 | === modified file 'hooks/charmhelpers/contrib/python/packages.py' | |||
28 | --- hooks/charmhelpers/contrib/python/packages.py 2015-01-26 09:42:44 +0000 | |||
29 | +++ hooks/charmhelpers/contrib/python/packages.py 2015-02-16 11:16:24 +0000 | |||
30 | @@ -17,8 +17,6 @@ | |||
31 | 17 | # You should have received a copy of the GNU Lesser General Public License | 17 | # You should have received a copy of the GNU Lesser General Public License |
32 | 18 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. | 18 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. |
33 | 19 | 19 | ||
34 | 20 | __author__ = "Jorge Niedbalski <jorge.niedbalski@canonical.com>" | ||
35 | 21 | |||
36 | 22 | from charmhelpers.fetch import apt_install, apt_update | 20 | from charmhelpers.fetch import apt_install, apt_update |
37 | 23 | from charmhelpers.core.hookenv import log | 21 | from charmhelpers.core.hookenv import log |
38 | 24 | 22 | ||
39 | @@ -29,6 +27,8 @@ | |||
40 | 29 | apt_install('python-pip') | 27 | apt_install('python-pip') |
41 | 30 | from pip import main as pip_execute | 28 | from pip import main as pip_execute |
42 | 31 | 29 | ||
43 | 30 | __author__ = "Jorge Niedbalski <jorge.niedbalski@canonical.com>" | ||
44 | 31 | |||
45 | 32 | 32 | ||
46 | 33 | def parse_options(given, available): | 33 | def parse_options(given, available): |
47 | 34 | """Given a set of options, check if available""" | 34 | """Given a set of options, check if available""" |
48 | 35 | 35 | ||
49 | === modified file 'hooks/charmhelpers/core/fstab.py' | |||
50 | --- hooks/charmhelpers/core/fstab.py 2015-01-26 09:42:44 +0000 | |||
51 | +++ hooks/charmhelpers/core/fstab.py 2015-02-16 11:16:24 +0000 | |||
52 | @@ -17,11 +17,11 @@ | |||
53 | 17 | # You should have received a copy of the GNU Lesser General Public License | 17 | # You should have received a copy of the GNU Lesser General Public License |
54 | 18 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. | 18 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. |
55 | 19 | 19 | ||
56 | 20 | __author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>' | ||
57 | 21 | |||
58 | 22 | import io | 20 | import io |
59 | 23 | import os | 21 | import os |
60 | 24 | 22 | ||
61 | 23 | __author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>' | ||
62 | 24 | |||
63 | 25 | 25 | ||
64 | 26 | class Fstab(io.FileIO): | 26 | class Fstab(io.FileIO): |
65 | 27 | """This class extends file in order to implement a file reader/writer | 27 | """This class extends file in order to implement a file reader/writer |
66 | 28 | 28 | ||
67 | === added file 'hooks/charmhelpers/core/strutils.py' | |||
68 | --- hooks/charmhelpers/core/strutils.py 1970-01-01 00:00:00 +0000 | |||
69 | +++ hooks/charmhelpers/core/strutils.py 2015-02-16 11:16:24 +0000 | |||
70 | @@ -0,0 +1,38 @@ | |||
71 | 1 | #!/usr/bin/env python | ||
72 | 2 | # -*- coding: utf-8 -*- | ||
73 | 3 | |||
74 | 4 | # Copyright 2014-2015 Canonical Limited. | ||
75 | 5 | # | ||
76 | 6 | # This file is part of charm-helpers. | ||
77 | 7 | # | ||
78 | 8 | # charm-helpers is free software: you can redistribute it and/or modify | ||
79 | 9 | # it under the terms of the GNU Lesser General Public License version 3 as | ||
80 | 10 | # published by the Free Software Foundation. | ||
81 | 11 | # | ||
82 | 12 | # charm-helpers is distributed in the hope that it will be useful, | ||
83 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
84 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
85 | 15 | # GNU Lesser General Public License for more details. | ||
86 | 16 | # | ||
87 | 17 | # You should have received a copy of the GNU Lesser General Public License | ||
88 | 18 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. | ||
89 | 19 | |||
90 | 20 | |||
91 | 21 | def bool_from_string(value): | ||
92 | 22 | """Interpret string value as boolean. | ||
93 | 23 | |||
94 | 24 | Returns True if value translates to True otherwise False. | ||
95 | 25 | """ | ||
96 | 26 | if isinstance(value, str): | ||
97 | 27 | value = value.lower() | ||
98 | 28 | else: | ||
99 | 29 | msg = "Unable to interpret non-string value '%s' as boolean" % (value) | ||
100 | 30 | raise ValueError(msg) | ||
101 | 31 | |||
102 | 32 | if value in ['y', 'yes', 'true', 't']: | ||
103 | 33 | return True | ||
104 | 34 | elif value in ['n', 'no', 'false', 'f']: | ||
105 | 35 | return False | ||
106 | 36 | |||
107 | 37 | msg = "Unable to interpret string value '%s' as boolean" % (value) | ||
108 | 38 | raise ValueError(msg) | ||
109 | 0 | 39 | ||
110 | === modified file 'hooks/charmhelpers/core/sysctl.py' | |||
111 | --- hooks/charmhelpers/core/sysctl.py 2015-02-11 12:37:28 +0000 | |||
112 | +++ hooks/charmhelpers/core/sysctl.py 2015-02-16 11:16:24 +0000 | |||
113 | @@ -17,8 +17,6 @@ | |||
114 | 17 | # You should have received a copy of the GNU Lesser General Public License | 17 | # You should have received a copy of the GNU Lesser General Public License |
115 | 18 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. | 18 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. |
116 | 19 | 19 | ||
117 | 20 | __author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>' | ||
118 | 21 | |||
119 | 22 | import yaml | 20 | import yaml |
120 | 23 | 21 | ||
121 | 24 | from subprocess import check_call | 22 | from subprocess import check_call |
122 | @@ -29,6 +27,8 @@ | |||
123 | 29 | ERROR, | 27 | ERROR, |
124 | 30 | ) | 28 | ) |
125 | 31 | 29 | ||
126 | 30 | __author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>' | ||
127 | 31 | |||
128 | 32 | 32 | ||
129 | 33 | def create(sysctl_dict, sysctl_file): | 33 | def create(sysctl_dict, sysctl_file): |
130 | 34 | """Creates a sysctl.conf file from a YAML associative array | 34 | """Creates a sysctl.conf file from a YAML associative array |
131 | 35 | 35 | ||
132 | === modified file 'hooks/charmhelpers/core/unitdata.py' | |||
133 | --- hooks/charmhelpers/core/unitdata.py 2015-02-11 12:37:28 +0000 | |||
134 | +++ hooks/charmhelpers/core/unitdata.py 2015-02-16 11:16:24 +0000 | |||
135 | @@ -435,7 +435,7 @@ | |||
136 | 435 | os.path.join(charm_dir, 'revision')).read().strip() | 435 | os.path.join(charm_dir, 'revision')).read().strip() |
137 | 436 | charm_rev = charm_rev or '0' | 436 | charm_rev = charm_rev or '0' |
138 | 437 | revs = self.kv.get('charm_revisions', []) | 437 | revs = self.kv.get('charm_revisions', []) |
140 | 438 | if not charm_rev in revs: | 438 | if charm_rev not in revs: |
141 | 439 | revs.append(charm_rev.strip() or '0') | 439 | revs.append(charm_rev.strip() or '0') |
142 | 440 | self.kv.set('charm_revisions', revs) | 440 | self.kv.set('charm_revisions', revs) |
143 | 441 | 441 | ||
144 | 442 | 442 | ||
145 | === modified file 'hooks/charmhelpers/fetch/archiveurl.py' | |||
146 | --- hooks/charmhelpers/fetch/archiveurl.py 2015-01-26 09:42:44 +0000 | |||
147 | +++ hooks/charmhelpers/fetch/archiveurl.py 2015-02-16 11:16:24 +0000 | |||
148 | @@ -18,6 +18,16 @@ | |||
149 | 18 | import hashlib | 18 | import hashlib |
150 | 19 | import re | 19 | import re |
151 | 20 | 20 | ||
152 | 21 | from charmhelpers.fetch import ( | ||
153 | 22 | BaseFetchHandler, | ||
154 | 23 | UnhandledSource | ||
155 | 24 | ) | ||
156 | 25 | from charmhelpers.payload.archive import ( | ||
157 | 26 | get_archive_handler, | ||
158 | 27 | extract, | ||
159 | 28 | ) | ||
160 | 29 | from charmhelpers.core.host import mkdir, check_hash | ||
161 | 30 | |||
162 | 21 | import six | 31 | import six |
163 | 22 | if six.PY3: | 32 | if six.PY3: |
164 | 23 | from urllib.request import ( | 33 | from urllib.request import ( |
165 | @@ -35,16 +45,6 @@ | |||
166 | 35 | ) | 45 | ) |
167 | 36 | from urlparse import urlparse, urlunparse, parse_qs | 46 | from urlparse import urlparse, urlunparse, parse_qs |
168 | 37 | 47 | ||
169 | 38 | from charmhelpers.fetch import ( | ||
170 | 39 | BaseFetchHandler, | ||
171 | 40 | UnhandledSource | ||
172 | 41 | ) | ||
173 | 42 | from charmhelpers.payload.archive import ( | ||
174 | 43 | get_archive_handler, | ||
175 | 44 | extract, | ||
176 | 45 | ) | ||
177 | 46 | from charmhelpers.core.host import mkdir, check_hash | ||
178 | 47 | |||
179 | 48 | 48 | ||
180 | 49 | def splituser(host): | 49 | def splituser(host): |
181 | 50 | '''urllib.splituser(), but six's support of this seems broken''' | 50 | '''urllib.splituser(), but six's support of this seems broken''' |
182 | 51 | 51 | ||
183 | === modified file 'hooks/charmhelpers/fetch/giturl.py' | |||
184 | --- hooks/charmhelpers/fetch/giturl.py 2015-01-26 09:42:44 +0000 | |||
185 | +++ hooks/charmhelpers/fetch/giturl.py 2015-02-16 11:16:24 +0000 | |||
186 | @@ -32,7 +32,7 @@ | |||
187 | 32 | apt_install("python-git") | 32 | apt_install("python-git") |
188 | 33 | from git import Repo | 33 | from git import Repo |
189 | 34 | 34 | ||
191 | 35 | from git.exc import GitCommandError | 35 | from git.exc import GitCommandError # noqa E402 |
192 | 36 | 36 | ||
193 | 37 | 37 | ||
194 | 38 | class GitUrlFetchHandler(BaseFetchHandler): | 38 | class GitUrlFetchHandler(BaseFetchHandler): |
195 | 39 | 39 | ||
196 | === modified file 'hooks/neutron_ovs_context.py' | |||
197 | --- hooks/neutron_ovs_context.py 2014-10-10 09:55:20 +0000 | |||
198 | +++ hooks/neutron_ovs_context.py 2015-02-16 11:16:24 +0000 | |||
199 | @@ -6,12 +6,12 @@ | |||
200 | 6 | unit_get, | 6 | unit_get, |
201 | 7 | ) | 7 | ) |
202 | 8 | from charmhelpers.core.host import list_nics, get_nic_hwaddr | 8 | from charmhelpers.core.host import list_nics, get_nic_hwaddr |
203 | 9 | from charmhelpers.core.strutils import bool_from_string | ||
204 | 9 | from charmhelpers.contrib.openstack import context | 10 | from charmhelpers.contrib.openstack import context |
205 | 10 | from charmhelpers.core.host import service_running, service_start | 11 | from charmhelpers.core.host import service_running, service_start |
206 | 11 | from charmhelpers.contrib.network.ovs import add_bridge, add_bridge_port | 12 | from charmhelpers.contrib.network.ovs import add_bridge, add_bridge_port |
207 | 12 | from charmhelpers.contrib.openstack.utils import get_host_ip | 13 | from charmhelpers.contrib.openstack.utils import get_host_ip |
208 | 13 | from charmhelpers.contrib.network.ip import get_address_in_network | 14 | from charmhelpers.contrib.network.ip import get_address_in_network |
209 | 14 | |||
210 | 15 | import re | 15 | import re |
211 | 16 | 16 | ||
212 | 17 | OVS_BRIDGE = 'br-int' | 17 | OVS_BRIDGE = 'br-int' |
213 | @@ -33,9 +33,11 @@ | |||
214 | 33 | if 'l2-population' not in rdata: | 33 | if 'l2-population' not in rdata: |
215 | 34 | continue | 34 | continue |
216 | 35 | neutron_settings = { | 35 | neutron_settings = { |
219 | 36 | 'l2_population': rdata['l2-population'], | 36 | 'l2_population': bool_from_string(rdata['l2-population']), |
218 | 37 | 'neutron_security_groups': rdata['neutron-security-groups'], | ||
220 | 38 | 'overlay_network_type': rdata['overlay-network-type'], | 37 | 'overlay_network_type': rdata['overlay-network-type'], |
221 | 38 | 'neutron_security_groups': bool_from_string( | ||
222 | 39 | rdata['neutron-security-groups'] | ||
223 | 40 | ), | ||
224 | 39 | } | 41 | } |
225 | 40 | # Override with configuration if set to true | 42 | # Override with configuration if set to true |
226 | 41 | if config('disable-security-groups'): | 43 | if config('disable-security-groups'): |
227 | 42 | 44 | ||
228 | === modified file 'unit_tests/test_neutron_ovs_context.py' | |||
229 | --- unit_tests/test_neutron_ovs_context.py 2014-10-10 09:55:20 +0000 | |||
230 | +++ unit_tests/test_neutron_ovs_context.py 2015-02-16 11:16:24 +0000 | |||
231 | @@ -88,8 +88,8 @@ | |||
232 | 88 | _is_clus.return_value = False | 88 | _is_clus.return_value = False |
233 | 89 | self.related_units.return_value = ['unit1'] | 89 | self.related_units.return_value = ['unit1'] |
234 | 90 | self.relation_ids.return_value = ['rid2'] | 90 | self.relation_ids.return_value = ['rid2'] |
237 | 91 | self.test_relation.set({'neutron-security-groups': True, | 91 | self.test_relation.set({'neutron-security-groups': 'True', |
238 | 92 | 'l2-population': True, | 92 | 'l2-population': 'True', |
239 | 93 | 'overlay-network-type': 'gre', | 93 | 'overlay-network-type': 'gre', |
240 | 94 | }) | 94 | }) |
241 | 95 | self.get_host_ip.return_value = '127.0.0.15' | 95 | self.get_host_ip.return_value = '127.0.0.15' |
242 | @@ -141,8 +141,8 @@ | |||
243 | 141 | self.test_config.set('disable-security-groups', True) | 141 | self.test_config.set('disable-security-groups', True) |
244 | 142 | self.related_units.return_value = ['unit1'] | 142 | self.related_units.return_value = ['unit1'] |
245 | 143 | self.relation_ids.return_value = ['rid2'] | 143 | self.relation_ids.return_value = ['rid2'] |
248 | 144 | self.test_relation.set({'neutron-security-groups': True, | 144 | self.test_relation.set({'neutron-security-groups': 'True', |
249 | 145 | 'l2-population': True, | 145 | 'l2-population': 'True', |
250 | 146 | 'overlay-network-type': 'gre', | 146 | 'overlay-network-type': 'gre', |
251 | 147 | }) | 147 | }) |
252 | 148 | self.get_host_ip.return_value = '127.0.0.15' | 148 | self.get_host_ip.return_value = '127.0.0.15' |
charm_lint_check #1954 neutron- openvswitch- next for gnuoy mp249535
LINT FAIL: lint-test failed
LINT Results (max last 2 lines): neutron_ ovs_context. py:43:80: E501 line too long (88 > 79 characters)
hooks/
make: *** [lint] Error 1
Full lint test output: http:// paste.ubuntu. com/10190756/ 10.245. 162.77: 8080/job/ charm_lint_ check/1954/
Build: http://