Merge lp:~james-page/charms/trusty/swift-storage/xenial into lp:~openstack-charmers-archive/charms/trusty/swift-storage/next
- Trusty Tahr (14.04)
- xenial
- Merge into next
Status: | Merged |
---|---|
Merged at revision: | 104 |
Proposed branch: | lp:~james-page/charms/trusty/swift-storage/xenial |
Merge into: | lp:~openstack-charmers-archive/charms/trusty/swift-storage/next |
Diff against target: |
663 lines (+177/-86) 12 files modified
charmhelpers/contrib/openstack/amulet/deployment.py (+3/-2) charmhelpers/contrib/openstack/context.py (+11/-7) charmhelpers/contrib/openstack/neutron.py (+18/-6) charmhelpers/contrib/openstack/utils.py (+65/-23) charmhelpers/contrib/python/packages.py (+22/-7) charmhelpers/core/host.py (+41/-26) charmhelpers/fetch/giturl.py (+3/-1) lib/swift_storage_context.py (+0/-3) lib/swift_storage_utils.py (+2/-1) tests/charmhelpers/contrib/openstack/amulet/deployment.py (+3/-2) unit_tests/test_swift_storage_context.py (+0/-4) unit_tests/test_swift_storage_utils.py (+9/-4) |
To merge this branch: | bzr merge lp:~james-page/charms/trusty/swift-storage/xenial |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenStack Charmers | Pending | ||
Review via email: mp+284515@code.launchpad.net |
This proposal supersedes a proposal from 2016-01-30.
Commit message
Description of the change
Resync helpers, fixup xenial support.
uosci-testing-bot (uosci-testing-bot) wrote : | # |
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #17133 swift-storage-next for james-page mp284515
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #9100 swift-storage-next for james-page mp284515
AMULET OK: passed
Build: http://
- 104. By James Page
-
Tidy lint
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #119 swift-storage-next for james-page mp284515
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #125 swift-storage-next for james-page mp284515
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #118 swift-storage-next for james-page mp284515
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #23 swift-storage-next for james-page mp284515
AMULET OK: passed
- 105. By James Page
-
Baseline
- 106. By James Page
-
Enable xenial mitaka tests
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #237 swift-storage-next for james-page mp284515
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #223 swift-storage-next for james-page mp284515
UNIT OK: passed
David Ames (thedac) wrote : | # |
Looks good. Waiting on amulet. With the possible exception of the xenial-mitaka amulet test which may fail due to dependencies.
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #118 swift-storage-next for james-page mp284515
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #124 swift-storage-next for james-page mp284515
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #130 swift-storage-next for james-page mp284515
AMULET OK: passed
Preview Diff
1 | === modified file 'charmhelpers/contrib/openstack/amulet/deployment.py' | |||
2 | --- charmhelpers/contrib/openstack/amulet/deployment.py 2016-01-04 21:31:57 +0000 | |||
3 | +++ charmhelpers/contrib/openstack/amulet/deployment.py 2016-02-11 16:47:55 +0000 | |||
4 | @@ -121,11 +121,12 @@ | |||
5 | 121 | 121 | ||
6 | 122 | # Charms which should use the source config option | 122 | # Charms which should use the source config option |
7 | 123 | use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', | 123 | use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', |
9 | 124 | 'ceph-osd', 'ceph-radosgw'] | 124 | 'ceph-osd', 'ceph-radosgw', 'ceph-mon'] |
10 | 125 | 125 | ||
11 | 126 | # Charms which can not use openstack-origin, ie. many subordinates | 126 | # Charms which can not use openstack-origin, ie. many subordinates |
12 | 127 | no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe', | 127 | no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe', |
14 | 128 | 'openvswitch-odl', 'neutron-api-odl', 'odl-controller'] | 128 | 'openvswitch-odl', 'neutron-api-odl', 'odl-controller', |
15 | 129 | 'cinder-backup'] | ||
16 | 129 | 130 | ||
17 | 130 | if self.openstack: | 131 | if self.openstack: |
18 | 131 | for svc in services: | 132 | for svc in services: |
19 | 132 | 133 | ||
20 | === modified file 'charmhelpers/contrib/openstack/context.py' | |||
21 | --- charmhelpers/contrib/openstack/context.py 2016-01-08 02:38:26 +0000 | |||
22 | +++ charmhelpers/contrib/openstack/context.py 2016-02-11 16:47:55 +0000 | |||
23 | @@ -90,6 +90,12 @@ | |||
24 | 90 | from charmhelpers.contrib.openstack.utils import get_host_ip | 90 | from charmhelpers.contrib.openstack.utils import get_host_ip |
25 | 91 | from charmhelpers.core.unitdata import kv | 91 | from charmhelpers.core.unitdata import kv |
26 | 92 | 92 | ||
27 | 93 | try: | ||
28 | 94 | import psutil | ||
29 | 95 | except ImportError: | ||
30 | 96 | apt_install('python-psutil', fatal=True) | ||
31 | 97 | import psutil | ||
32 | 98 | |||
33 | 93 | CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt' | 99 | CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt' |
34 | 94 | ADDRESS_TYPES = ['admin', 'internal', 'public'] | 100 | ADDRESS_TYPES = ['admin', 'internal', 'public'] |
35 | 95 | 101 | ||
36 | @@ -1258,13 +1264,11 @@ | |||
37 | 1258 | 1264 | ||
38 | 1259 | @property | 1265 | @property |
39 | 1260 | def num_cpus(self): | 1266 | def num_cpus(self): |
47 | 1261 | try: | 1267 | # NOTE: use cpu_count if present (16.04 support) |
48 | 1262 | from psutil import NUM_CPUS | 1268 | if hasattr(psutil, 'cpu_count'): |
49 | 1263 | except ImportError: | 1269 | return psutil.cpu_count() |
50 | 1264 | apt_install('python-psutil', fatal=True) | 1270 | else: |
51 | 1265 | from psutil import NUM_CPUS | 1271 | return psutil.NUM_CPUS |
45 | 1266 | |||
46 | 1267 | return NUM_CPUS | ||
52 | 1268 | 1272 | ||
53 | 1269 | def __call__(self): | 1273 | def __call__(self): |
54 | 1270 | multiplier = config('worker-multiplier') or 0 | 1274 | multiplier = config('worker-multiplier') or 0 |
55 | 1271 | 1275 | ||
56 | === modified file 'charmhelpers/contrib/openstack/neutron.py' | |||
57 | --- charmhelpers/contrib/openstack/neutron.py 2016-01-04 21:31:57 +0000 | |||
58 | +++ charmhelpers/contrib/openstack/neutron.py 2016-02-11 16:47:55 +0000 | |||
59 | @@ -50,7 +50,7 @@ | |||
60 | 50 | if kernel_version() >= (3, 13): | 50 | if kernel_version() >= (3, 13): |
61 | 51 | return [] | 51 | return [] |
62 | 52 | else: | 52 | else: |
64 | 53 | return ['openvswitch-datapath-dkms'] | 53 | return [headers_package(), 'openvswitch-datapath-dkms'] |
65 | 54 | 54 | ||
66 | 55 | 55 | ||
67 | 56 | # legacy | 56 | # legacy |
68 | @@ -70,7 +70,7 @@ | |||
69 | 70 | relation_prefix='neutron', | 70 | relation_prefix='neutron', |
70 | 71 | ssl_dir=QUANTUM_CONF_DIR)], | 71 | ssl_dir=QUANTUM_CONF_DIR)], |
71 | 72 | 'services': ['quantum-plugin-openvswitch-agent'], | 72 | 'services': ['quantum-plugin-openvswitch-agent'], |
73 | 73 | 'packages': [[headers_package()] + determine_dkms_package(), | 73 | 'packages': [determine_dkms_package(), |
74 | 74 | ['quantum-plugin-openvswitch-agent']], | 74 | ['quantum-plugin-openvswitch-agent']], |
75 | 75 | 'server_packages': ['quantum-server', | 75 | 'server_packages': ['quantum-server', |
76 | 76 | 'quantum-plugin-openvswitch'], | 76 | 'quantum-plugin-openvswitch'], |
77 | @@ -111,7 +111,7 @@ | |||
78 | 111 | relation_prefix='neutron', | 111 | relation_prefix='neutron', |
79 | 112 | ssl_dir=NEUTRON_CONF_DIR)], | 112 | ssl_dir=NEUTRON_CONF_DIR)], |
80 | 113 | 'services': ['neutron-plugin-openvswitch-agent'], | 113 | 'services': ['neutron-plugin-openvswitch-agent'], |
82 | 114 | 'packages': [[headers_package()] + determine_dkms_package(), | 114 | 'packages': [determine_dkms_package(), |
83 | 115 | ['neutron-plugin-openvswitch-agent']], | 115 | ['neutron-plugin-openvswitch-agent']], |
84 | 116 | 'server_packages': ['neutron-server', | 116 | 'server_packages': ['neutron-server', |
85 | 117 | 'neutron-plugin-openvswitch'], | 117 | 'neutron-plugin-openvswitch'], |
86 | @@ -155,7 +155,7 @@ | |||
87 | 155 | relation_prefix='neutron', | 155 | relation_prefix='neutron', |
88 | 156 | ssl_dir=NEUTRON_CONF_DIR)], | 156 | ssl_dir=NEUTRON_CONF_DIR)], |
89 | 157 | 'services': [], | 157 | 'services': [], |
91 | 158 | 'packages': [[headers_package()] + determine_dkms_package(), | 158 | 'packages': [determine_dkms_package(), |
92 | 159 | ['neutron-plugin-cisco']], | 159 | ['neutron-plugin-cisco']], |
93 | 160 | 'server_packages': ['neutron-server', | 160 | 'server_packages': ['neutron-server', |
94 | 161 | 'neutron-plugin-cisco'], | 161 | 'neutron-plugin-cisco'], |
95 | @@ -174,7 +174,7 @@ | |||
96 | 174 | 'neutron-dhcp-agent', | 174 | 'neutron-dhcp-agent', |
97 | 175 | 'nova-api-metadata', | 175 | 'nova-api-metadata', |
98 | 176 | 'etcd'], | 176 | 'etcd'], |
100 | 177 | 'packages': [[headers_package()] + determine_dkms_package(), | 177 | 'packages': [determine_dkms_package(), |
101 | 178 | ['calico-compute', | 178 | ['calico-compute', |
102 | 179 | 'bird', | 179 | 'bird', |
103 | 180 | 'neutron-dhcp-agent', | 180 | 'neutron-dhcp-agent', |
104 | @@ -219,7 +219,7 @@ | |||
105 | 219 | relation_prefix='neutron', | 219 | relation_prefix='neutron', |
106 | 220 | ssl_dir=NEUTRON_CONF_DIR)], | 220 | ssl_dir=NEUTRON_CONF_DIR)], |
107 | 221 | 'services': [], | 221 | 'services': [], |
109 | 222 | 'packages': [[headers_package()] + determine_dkms_package()], | 222 | 'packages': [determine_dkms_package()], |
110 | 223 | 'server_packages': ['neutron-server', | 223 | 'server_packages': ['neutron-server', |
111 | 224 | 'python-neutron-plugin-midonet'], | 224 | 'python-neutron-plugin-midonet'], |
112 | 225 | 'server_services': ['neutron-server'] | 225 | 'server_services': ['neutron-server'] |
113 | @@ -233,6 +233,18 @@ | |||
114 | 233 | 'neutron-plugin-ml2'] | 233 | 'neutron-plugin-ml2'] |
115 | 234 | # NOTE: patch in vmware renames nvp->nsx for icehouse onwards | 234 | # NOTE: patch in vmware renames nvp->nsx for icehouse onwards |
116 | 235 | plugins['nvp'] = plugins['nsx'] | 235 | plugins['nvp'] = plugins['nsx'] |
117 | 236 | if release >= 'kilo': | ||
118 | 237 | plugins['midonet']['driver'] = ( | ||
119 | 238 | 'neutron.plugins.midonet.plugin.MidonetPluginV2') | ||
120 | 239 | if release >= 'liberty': | ||
121 | 240 | midonet_origin = config('midonet-origin') | ||
122 | 241 | if midonet_origin is not None and midonet_origin[4:5] == '1': | ||
123 | 242 | plugins['midonet']['driver'] = ( | ||
124 | 243 | 'midonet.neutron.plugin_v1.MidonetPluginV2') | ||
125 | 244 | plugins['midonet']['server_packages'].remove( | ||
126 | 245 | 'python-neutron-plugin-midonet') | ||
127 | 246 | plugins['midonet']['server_packages'].append( | ||
128 | 247 | 'python-networking-midonet') | ||
129 | 236 | return plugins | 248 | return plugins |
130 | 237 | 249 | ||
131 | 238 | 250 | ||
132 | 239 | 251 | ||
133 | === modified file 'charmhelpers/contrib/openstack/utils.py' | |||
134 | --- charmhelpers/contrib/openstack/utils.py 2016-01-13 18:36:55 +0000 | |||
135 | +++ charmhelpers/contrib/openstack/utils.py 2016-02-11 16:47:55 +0000 | |||
136 | @@ -25,6 +25,7 @@ | |||
137 | 25 | import re | 25 | import re |
138 | 26 | 26 | ||
139 | 27 | import six | 27 | import six |
140 | 28 | import tempfile | ||
141 | 28 | import traceback | 29 | import traceback |
142 | 29 | import uuid | 30 | import uuid |
143 | 30 | import yaml | 31 | import yaml |
144 | @@ -41,6 +42,7 @@ | |||
145 | 41 | config, | 42 | config, |
146 | 42 | log as juju_log, | 43 | log as juju_log, |
147 | 43 | charm_dir, | 44 | charm_dir, |
148 | 45 | DEBUG, | ||
149 | 44 | INFO, | 46 | INFO, |
150 | 45 | related_units, | 47 | related_units, |
151 | 46 | relation_ids, | 48 | relation_ids, |
152 | @@ -105,16 +107,26 @@ | |||
153 | 105 | 107 | ||
154 | 106 | # The ugly duckling - must list releases oldest to newest | 108 | # The ugly duckling - must list releases oldest to newest |
155 | 107 | SWIFT_CODENAMES = OrderedDict([ | 109 | SWIFT_CODENAMES = OrderedDict([ |
166 | 108 | ('diablo', ['1.4.3']), | 110 | ('diablo', |
167 | 109 | ('essex', ['1.4.8']), | 111 | ['1.4.3']), |
168 | 110 | ('folsom', ['1.7.4']), | 112 | ('essex', |
169 | 111 | ('grizzly', ['1.7.6', '1.7.7', '1.8.0']), | 113 | ['1.4.8']), |
170 | 112 | ('havana', ['1.9.0', '1.9.1', '1.10.0']), | 114 | ('folsom', |
171 | 113 | ('icehouse', ['1.11.0', '1.12.0', '1.13.0', '1.13.1']), | 115 | ['1.7.4']), |
172 | 114 | ('juno', ['2.0.0', '2.1.0', '2.2.0']), | 116 | ('grizzly', |
173 | 115 | ('kilo', ['2.2.1', '2.2.2']), | 117 | ['1.7.6', '1.7.7', '1.8.0']), |
174 | 116 | ('liberty', ['2.3.0', '2.4.0', '2.5.0']), | 118 | ('havana', |
175 | 117 | ('mitaka', ['2.5.0']), | 119 | ['1.9.0', '1.9.1', '1.10.0']), |
176 | 120 | ('icehouse', | ||
177 | 121 | ['1.11.0', '1.12.0', '1.13.0', '1.13.1']), | ||
178 | 122 | ('juno', | ||
179 | 123 | ['2.0.0', '2.1.0', '2.2.0']), | ||
180 | 124 | ('kilo', | ||
181 | 125 | ['2.2.1', '2.2.2']), | ||
182 | 126 | ('liberty', | ||
183 | 127 | ['2.3.0', '2.4.0', '2.5.0']), | ||
184 | 128 | ('mitaka', | ||
185 | 129 | ['2.5.0']), | ||
186 | 118 | ]) | 130 | ]) |
187 | 119 | 131 | ||
188 | 120 | # >= Liberty version->codename mapping | 132 | # >= Liberty version->codename mapping |
189 | @@ -337,12 +349,42 @@ | |||
190 | 337 | 349 | ||
191 | 338 | 350 | ||
192 | 339 | def import_key(keyid): | 351 | def import_key(keyid): |
199 | 340 | cmd = "apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 " \ | 352 | key = keyid.strip() |
200 | 341 | "--recv-keys %s" % keyid | 353 | if (key.startswith('-----BEGIN PGP PUBLIC KEY BLOCK-----') and |
201 | 342 | try: | 354 | key.endswith('-----END PGP PUBLIC KEY BLOCK-----')): |
202 | 343 | subprocess.check_call(cmd.split(' ')) | 355 | juju_log("PGP key found (looks like ASCII Armor format)", level=DEBUG) |
203 | 344 | except subprocess.CalledProcessError: | 356 | juju_log("Importing ASCII Armor PGP key", level=DEBUG) |
204 | 345 | error_out("Error importing repo key %s" % keyid) | 357 | with tempfile.NamedTemporaryFile() as keyfile: |
205 | 358 | with open(keyfile.name, 'w') as fd: | ||
206 | 359 | fd.write(key) | ||
207 | 360 | fd.write("\n") | ||
208 | 361 | |||
209 | 362 | cmd = ['apt-key', 'add', keyfile.name] | ||
210 | 363 | try: | ||
211 | 364 | subprocess.check_call(cmd) | ||
212 | 365 | except subprocess.CalledProcessError: | ||
213 | 366 | error_out("Error importing PGP key '%s'" % key) | ||
214 | 367 | else: | ||
215 | 368 | juju_log("PGP key found (looks like Radix64 format)", level=DEBUG) | ||
216 | 369 | juju_log("Importing PGP key from keyserver", level=DEBUG) | ||
217 | 370 | cmd = ['apt-key', 'adv', '--keyserver', | ||
218 | 371 | 'hkp://keyserver.ubuntu.com:80', '--recv-keys', key] | ||
219 | 372 | try: | ||
220 | 373 | subprocess.check_call(cmd) | ||
221 | 374 | except subprocess.CalledProcessError: | ||
222 | 375 | error_out("Error importing PGP key '%s'" % key) | ||
223 | 376 | |||
224 | 377 | |||
225 | 378 | def get_source_and_pgp_key(input): | ||
226 | 379 | """Look for a pgp key ID or ascii-armor key in the given input.""" | ||
227 | 380 | index = input.strip() | ||
228 | 381 | index = input.rfind('|') | ||
229 | 382 | if index < 0: | ||
230 | 383 | return input, None | ||
231 | 384 | |||
232 | 385 | key = input[index + 1:].strip('|') | ||
233 | 386 | source = input[:index] | ||
234 | 387 | return source, key | ||
235 | 346 | 388 | ||
236 | 347 | 389 | ||
237 | 348 | def configure_installation_source(rel): | 390 | def configure_installation_source(rel): |
238 | @@ -354,16 +396,16 @@ | |||
239 | 354 | with open('/etc/apt/sources.list.d/juju_deb.list', 'w') as f: | 396 | with open('/etc/apt/sources.list.d/juju_deb.list', 'w') as f: |
240 | 355 | f.write(DISTRO_PROPOSED % ubuntu_rel) | 397 | f.write(DISTRO_PROPOSED % ubuntu_rel) |
241 | 356 | elif rel[:4] == "ppa:": | 398 | elif rel[:4] == "ppa:": |
243 | 357 | src = rel | 399 | src, key = get_source_and_pgp_key(rel) |
244 | 400 | if key: | ||
245 | 401 | import_key(key) | ||
246 | 402 | |||
247 | 358 | subprocess.check_call(["add-apt-repository", "-y", src]) | 403 | subprocess.check_call(["add-apt-repository", "-y", src]) |
248 | 359 | elif rel[:3] == "deb": | 404 | elif rel[:3] == "deb": |
253 | 360 | l = len(rel.split('|')) | 405 | src, key = get_source_and_pgp_key(rel) |
254 | 361 | if l == 2: | 406 | if key: |
251 | 362 | src, key = rel.split('|') | ||
252 | 363 | juju_log("Importing PPA key from keyserver for %s" % src) | ||
255 | 364 | import_key(key) | 407 | import_key(key) |
258 | 365 | elif l == 1: | 408 | |
257 | 366 | src = rel | ||
259 | 367 | with open('/etc/apt/sources.list.d/juju_deb.list', 'w') as f: | 409 | with open('/etc/apt/sources.list.d/juju_deb.list', 'w') as f: |
260 | 368 | f.write(src) | 410 | f.write(src) |
261 | 369 | elif rel[:6] == 'cloud:': | 411 | elif rel[:6] == 'cloud:': |
262 | 370 | 412 | ||
263 | === modified file 'charmhelpers/contrib/python/packages.py' | |||
264 | --- charmhelpers/contrib/python/packages.py 2016-01-04 21:31:57 +0000 | |||
265 | +++ charmhelpers/contrib/python/packages.py 2016-02-11 16:47:55 +0000 | |||
266 | @@ -19,20 +19,35 @@ | |||
267 | 19 | 19 | ||
268 | 20 | import os | 20 | import os |
269 | 21 | import subprocess | 21 | import subprocess |
270 | 22 | import sys | ||
271 | 22 | 23 | ||
272 | 23 | from charmhelpers.fetch import apt_install, apt_update | 24 | from charmhelpers.fetch import apt_install, apt_update |
273 | 24 | from charmhelpers.core.hookenv import charm_dir, log | 25 | from charmhelpers.core.hookenv import charm_dir, log |
274 | 25 | 26 | ||
275 | 26 | try: | ||
276 | 27 | from pip import main as pip_execute | ||
277 | 28 | except ImportError: | ||
278 | 29 | apt_update() | ||
279 | 30 | apt_install('python-pip') | ||
280 | 31 | from pip import main as pip_execute | ||
281 | 32 | |||
282 | 33 | __author__ = "Jorge Niedbalski <jorge.niedbalski@canonical.com>" | 27 | __author__ = "Jorge Niedbalski <jorge.niedbalski@canonical.com>" |
283 | 34 | 28 | ||
284 | 35 | 29 | ||
285 | 30 | def pip_execute(*args, **kwargs): | ||
286 | 31 | """Overriden pip_execute() to stop sys.path being changed. | ||
287 | 32 | |||
288 | 33 | The act of importing main from the pip module seems to cause add wheels | ||
289 | 34 | from the /usr/share/python-wheels which are installed by various tools. | ||
290 | 35 | This function ensures that sys.path remains the same after the call is | ||
291 | 36 | executed. | ||
292 | 37 | """ | ||
293 | 38 | try: | ||
294 | 39 | _path = sys.path | ||
295 | 40 | try: | ||
296 | 41 | from pip import main as _pip_execute | ||
297 | 42 | except ImportError: | ||
298 | 43 | apt_update() | ||
299 | 44 | apt_install('python-pip') | ||
300 | 45 | from pip import main as _pip_execute | ||
301 | 46 | _pip_execute(*args, **kwargs) | ||
302 | 47 | finally: | ||
303 | 48 | sys.path = _path | ||
304 | 49 | |||
305 | 50 | |||
306 | 36 | def parse_options(given, available): | 51 | def parse_options(given, available): |
307 | 37 | """Given a set of options, check if available""" | 52 | """Given a set of options, check if available""" |
308 | 38 | for key, value in sorted(given.items()): | 53 | for key, value in sorted(given.items()): |
309 | 39 | 54 | ||
310 | === modified file 'charmhelpers/core/host.py' | |||
311 | --- charmhelpers/core/host.py 2016-01-07 09:19:41 +0000 | |||
312 | +++ charmhelpers/core/host.py 2016-02-11 16:47:55 +0000 | |||
313 | @@ -138,7 +138,8 @@ | |||
314 | 138 | except subprocess.CalledProcessError: | 138 | except subprocess.CalledProcessError: |
315 | 139 | return False | 139 | return False |
316 | 140 | else: | 140 | else: |
318 | 141 | if ("start/running" in output or "is running" in output): | 141 | if ("start/running" in output or "is running" in output or |
319 | 142 | "up and running" in output): | ||
320 | 142 | return True | 143 | return True |
321 | 143 | else: | 144 | else: |
322 | 144 | return False | 145 | return False |
323 | @@ -160,13 +161,13 @@ | |||
324 | 160 | 161 | ||
325 | 161 | 162 | ||
326 | 162 | def init_is_systemd(): | 163 | def init_is_systemd(): |
327 | 164 | """Return True if the host system uses systemd, False otherwise.""" | ||
328 | 163 | return os.path.isdir(SYSTEMD_SYSTEM) | 165 | return os.path.isdir(SYSTEMD_SYSTEM) |
329 | 164 | 166 | ||
330 | 165 | 167 | ||
331 | 166 | def adduser(username, password=None, shell='/bin/bash', system_user=False, | 168 | def adduser(username, password=None, shell='/bin/bash', system_user=False, |
332 | 167 | primary_group=None, secondary_groups=None): | 169 | primary_group=None, secondary_groups=None): |
335 | 168 | """ | 170 | """Add a user to the system. |
334 | 169 | Add a user to the system. | ||
336 | 170 | 171 | ||
337 | 171 | Will log but otherwise succeed if the user already exists. | 172 | Will log but otherwise succeed if the user already exists. |
338 | 172 | 173 | ||
339 | @@ -174,7 +175,7 @@ | |||
340 | 174 | :param str password: Password for user; if ``None``, create a system user | 175 | :param str password: Password for user; if ``None``, create a system user |
341 | 175 | :param str shell: The default shell for the user | 176 | :param str shell: The default shell for the user |
342 | 176 | :param bool system_user: Whether to create a login or system user | 177 | :param bool system_user: Whether to create a login or system user |
344 | 177 | :param str primary_group: Primary group for user; defaults to their username | 178 | :param str primary_group: Primary group for user; defaults to username |
345 | 178 | :param list secondary_groups: Optional list of additional groups | 179 | :param list secondary_groups: Optional list of additional groups |
346 | 179 | 180 | ||
347 | 180 | :returns: The password database entry struct, as returned by `pwd.getpwnam` | 181 | :returns: The password database entry struct, as returned by `pwd.getpwnam` |
348 | @@ -300,14 +301,12 @@ | |||
349 | 300 | 301 | ||
350 | 301 | 302 | ||
351 | 302 | def fstab_remove(mp): | 303 | def fstab_remove(mp): |
354 | 303 | """Remove the given mountpoint entry from /etc/fstab | 304 | """Remove the given mountpoint entry from /etc/fstab""" |
353 | 304 | """ | ||
355 | 305 | return Fstab.remove_by_mountpoint(mp) | 305 | return Fstab.remove_by_mountpoint(mp) |
356 | 306 | 306 | ||
357 | 307 | 307 | ||
358 | 308 | def fstab_add(dev, mp, fs, options=None): | 308 | def fstab_add(dev, mp, fs, options=None): |
361 | 309 | """Adds the given device entry to the /etc/fstab file | 309 | """Adds the given device entry to the /etc/fstab file""" |
360 | 310 | """ | ||
362 | 311 | return Fstab.add(dev, mp, fs, options=options) | 310 | return Fstab.add(dev, mp, fs, options=options) |
363 | 312 | 311 | ||
364 | 313 | 312 | ||
365 | @@ -363,8 +362,7 @@ | |||
366 | 363 | 362 | ||
367 | 364 | 363 | ||
368 | 365 | def file_hash(path, hash_type='md5'): | 364 | def file_hash(path, hash_type='md5'): |
371 | 366 | """ | 365 | """Generate a hash checksum of the contents of 'path' or None if not found. |
370 | 367 | Generate a hash checksum of the contents of 'path' or None if not found. | ||
372 | 368 | 366 | ||
373 | 369 | :param str hash_type: Any hash alrgorithm supported by :mod:`hashlib`, | 367 | :param str hash_type: Any hash alrgorithm supported by :mod:`hashlib`, |
374 | 370 | such as md5, sha1, sha256, sha512, etc. | 368 | such as md5, sha1, sha256, sha512, etc. |
375 | @@ -379,10 +377,9 @@ | |||
376 | 379 | 377 | ||
377 | 380 | 378 | ||
378 | 381 | def path_hash(path): | 379 | def path_hash(path): |
383 | 382 | """ | 380 | """Generate a hash checksum of all files matching 'path'. Standard |
384 | 383 | Generate a hash checksum of all files matching 'path'. Standard wildcards | 381 | wildcards like '*' and '?' are supported, see documentation for the 'glob' |
385 | 384 | like '*' and '?' are supported, see documentation for the 'glob' module for | 382 | module for more information. |
382 | 385 | more information. | ||
386 | 386 | 383 | ||
387 | 387 | :return: dict: A { filename: hash } dictionary for all matched files. | 384 | :return: dict: A { filename: hash } dictionary for all matched files. |
388 | 388 | Empty if none found. | 385 | Empty if none found. |
389 | @@ -394,8 +391,7 @@ | |||
390 | 394 | 391 | ||
391 | 395 | 392 | ||
392 | 396 | def check_hash(path, checksum, hash_type='md5'): | 393 | def check_hash(path, checksum, hash_type='md5'): |
395 | 397 | """ | 394 | """Validate a file using a cryptographic checksum. |
394 | 398 | Validate a file using a cryptographic checksum. | ||
396 | 399 | 395 | ||
397 | 400 | :param str checksum: Value of the checksum used to validate the file. | 396 | :param str checksum: Value of the checksum used to validate the file. |
398 | 401 | :param str hash_type: Hash algorithm used to generate `checksum`. | 397 | :param str hash_type: Hash algorithm used to generate `checksum`. |
399 | @@ -410,6 +406,7 @@ | |||
400 | 410 | 406 | ||
401 | 411 | 407 | ||
402 | 412 | class ChecksumError(ValueError): | 408 | class ChecksumError(ValueError): |
403 | 409 | """A class derived from Value error to indicate the checksum failed.""" | ||
404 | 413 | pass | 410 | pass |
405 | 414 | 411 | ||
406 | 415 | 412 | ||
407 | @@ -515,7 +512,7 @@ | |||
408 | 515 | 512 | ||
409 | 516 | 513 | ||
410 | 517 | def list_nics(nic_type=None): | 514 | def list_nics(nic_type=None): |
412 | 518 | '''Return a list of nics of given type(s)''' | 515 | """Return a list of nics of given type(s)""" |
413 | 519 | if isinstance(nic_type, six.string_types): | 516 | if isinstance(nic_type, six.string_types): |
414 | 520 | int_types = [nic_type] | 517 | int_types = [nic_type] |
415 | 521 | else: | 518 | else: |
416 | @@ -557,12 +554,13 @@ | |||
417 | 557 | 554 | ||
418 | 558 | 555 | ||
419 | 559 | def set_nic_mtu(nic, mtu): | 556 | def set_nic_mtu(nic, mtu): |
421 | 560 | '''Set MTU on a network interface''' | 557 | """Set the Maximum Transmission Unit (MTU) on a network interface.""" |
422 | 561 | cmd = ['ip', 'link', 'set', nic, 'mtu', mtu] | 558 | cmd = ['ip', 'link', 'set', nic, 'mtu', mtu] |
423 | 562 | subprocess.check_call(cmd) | 559 | subprocess.check_call(cmd) |
424 | 563 | 560 | ||
425 | 564 | 561 | ||
426 | 565 | def get_nic_mtu(nic): | 562 | def get_nic_mtu(nic): |
427 | 563 | """Return the Maximum Transmission Unit (MTU) for a network interface.""" | ||
428 | 566 | cmd = ['ip', 'addr', 'show', nic] | 564 | cmd = ['ip', 'addr', 'show', nic] |
429 | 567 | ip_output = subprocess.check_output(cmd).decode('UTF-8').split('\n') | 565 | ip_output = subprocess.check_output(cmd).decode('UTF-8').split('\n') |
430 | 568 | mtu = "" | 566 | mtu = "" |
431 | @@ -574,6 +572,7 @@ | |||
432 | 574 | 572 | ||
433 | 575 | 573 | ||
434 | 576 | def get_nic_hwaddr(nic): | 574 | def get_nic_hwaddr(nic): |
435 | 575 | """Return the Media Access Control (MAC) for a network interface.""" | ||
436 | 577 | cmd = ['ip', '-o', '-0', 'addr', 'show', nic] | 576 | cmd = ['ip', '-o', '-0', 'addr', 'show', nic] |
437 | 578 | ip_output = subprocess.check_output(cmd).decode('UTF-8') | 577 | ip_output = subprocess.check_output(cmd).decode('UTF-8') |
438 | 579 | hwaddr = "" | 578 | hwaddr = "" |
439 | @@ -584,7 +583,7 @@ | |||
440 | 584 | 583 | ||
441 | 585 | 584 | ||
442 | 586 | def cmp_pkgrevno(package, revno, pkgcache=None): | 585 | def cmp_pkgrevno(package, revno, pkgcache=None): |
444 | 587 | '''Compare supplied revno with the revno of the installed package | 586 | """Compare supplied revno with the revno of the installed package |
445 | 588 | 587 | ||
446 | 589 | * 1 => Installed revno is greater than supplied arg | 588 | * 1 => Installed revno is greater than supplied arg |
447 | 590 | * 0 => Installed revno is the same as supplied arg | 589 | * 0 => Installed revno is the same as supplied arg |
448 | @@ -593,7 +592,7 @@ | |||
449 | 593 | This function imports apt_cache function from charmhelpers.fetch if | 592 | This function imports apt_cache function from charmhelpers.fetch if |
450 | 594 | the pkgcache argument is None. Be sure to add charmhelpers.fetch if | 593 | the pkgcache argument is None. Be sure to add charmhelpers.fetch if |
451 | 595 | you call this function, or pass an apt_pkg.Cache() instance. | 594 | you call this function, or pass an apt_pkg.Cache() instance. |
453 | 596 | ''' | 595 | """ |
454 | 597 | import apt_pkg | 596 | import apt_pkg |
455 | 598 | if not pkgcache: | 597 | if not pkgcache: |
456 | 599 | from charmhelpers.fetch import apt_cache | 598 | from charmhelpers.fetch import apt_cache |
457 | @@ -603,19 +602,27 @@ | |||
458 | 603 | 602 | ||
459 | 604 | 603 | ||
460 | 605 | @contextmanager | 604 | @contextmanager |
462 | 606 | def chdir(d): | 605 | def chdir(directory): |
463 | 606 | """Change the current working directory to a different directory for a code | ||
464 | 607 | block and return the previous directory after the block exits. Useful to | ||
465 | 608 | run commands from a specificed directory. | ||
466 | 609 | |||
467 | 610 | :param str directory: The directory path to change to for this context. | ||
468 | 611 | """ | ||
469 | 607 | cur = os.getcwd() | 612 | cur = os.getcwd() |
470 | 608 | try: | 613 | try: |
472 | 609 | yield os.chdir(d) | 614 | yield os.chdir(directory) |
473 | 610 | finally: | 615 | finally: |
474 | 611 | os.chdir(cur) | 616 | os.chdir(cur) |
475 | 612 | 617 | ||
476 | 613 | 618 | ||
477 | 614 | def chownr(path, owner, group, follow_links=True, chowntopdir=False): | 619 | def chownr(path, owner, group, follow_links=True, chowntopdir=False): |
480 | 615 | """ | 620 | """Recursively change user and group ownership of files and directories |
479 | 616 | Recursively change user and group ownership of files and directories | ||
481 | 617 | in given path. Doesn't chown path itself by default, only its children. | 621 | in given path. Doesn't chown path itself by default, only its children. |
482 | 618 | 622 | ||
483 | 623 | :param str path: The string path to start changing ownership. | ||
484 | 624 | :param str owner: The owner string to use when looking up the uid. | ||
485 | 625 | :param str group: The group string to use when looking up the gid. | ||
486 | 619 | :param bool follow_links: Also Chown links if True | 626 | :param bool follow_links: Also Chown links if True |
487 | 620 | :param bool chowntopdir: Also chown path itself if True | 627 | :param bool chowntopdir: Also chown path itself if True |
488 | 621 | """ | 628 | """ |
489 | @@ -639,15 +646,23 @@ | |||
490 | 639 | 646 | ||
491 | 640 | 647 | ||
492 | 641 | def lchownr(path, owner, group): | 648 | def lchownr(path, owner, group): |
493 | 649 | """Recursively change user and group ownership of files and directories | ||
494 | 650 | in a given path, not following symbolic links. See the documentation for | ||
495 | 651 | 'os.lchown' for more information. | ||
496 | 652 | |||
497 | 653 | :param str path: The string path to start changing ownership. | ||
498 | 654 | :param str owner: The owner string to use when looking up the uid. | ||
499 | 655 | :param str group: The group string to use when looking up the gid. | ||
500 | 656 | """ | ||
501 | 642 | chownr(path, owner, group, follow_links=False) | 657 | chownr(path, owner, group, follow_links=False) |
502 | 643 | 658 | ||
503 | 644 | 659 | ||
504 | 645 | def get_total_ram(): | 660 | def get_total_ram(): |
506 | 646 | '''The total amount of system RAM in bytes. | 661 | """The total amount of system RAM in bytes. |
507 | 647 | 662 | ||
508 | 648 | This is what is reported by the OS, and may be overcommitted when | 663 | This is what is reported by the OS, and may be overcommitted when |
509 | 649 | there are multiple containers hosted on the same machine. | 664 | there are multiple containers hosted on the same machine. |
511 | 650 | ''' | 665 | """ |
512 | 651 | with open('/proc/meminfo', 'r') as f: | 666 | with open('/proc/meminfo', 'r') as f: |
513 | 652 | for line in f.readlines(): | 667 | for line in f.readlines(): |
514 | 653 | if line: | 668 | if line: |
515 | 654 | 669 | ||
516 | === modified file 'charmhelpers/fetch/giturl.py' | |||
517 | --- charmhelpers/fetch/giturl.py 2016-01-13 18:36:55 +0000 | |||
518 | +++ charmhelpers/fetch/giturl.py 2016-02-11 16:47:55 +0000 | |||
519 | @@ -15,7 +15,7 @@ | |||
520 | 15 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. |
521 | 16 | 16 | ||
522 | 17 | import os | 17 | import os |
524 | 18 | from subprocess import check_call | 18 | from subprocess import check_call, CalledProcessError |
525 | 19 | from charmhelpers.fetch import ( | 19 | from charmhelpers.fetch import ( |
526 | 20 | BaseFetchHandler, | 20 | BaseFetchHandler, |
527 | 21 | UnhandledSource, | 21 | UnhandledSource, |
528 | @@ -63,6 +63,8 @@ | |||
529 | 63 | branch_name) | 63 | branch_name) |
530 | 64 | try: | 64 | try: |
531 | 65 | self.clone(source, dest_dir, branch, depth) | 65 | self.clone(source, dest_dir, branch, depth) |
532 | 66 | except CalledProcessError as e: | ||
533 | 67 | raise UnhandledSource(e) | ||
534 | 66 | except OSError as e: | 68 | except OSError as e: |
535 | 67 | raise UnhandledSource(e.strerror) | 69 | raise UnhandledSource(e.strerror) |
536 | 68 | return dest_dir | 70 | return dest_dir |
537 | 69 | 71 | ||
538 | === modified file 'lib/swift_storage_context.py' | |||
539 | --- lib/swift_storage_context.py 2015-11-24 13:51:05 +0000 | |||
540 | +++ lib/swift_storage_context.py 2016-02-11 16:47:55 +0000 | |||
541 | @@ -80,14 +80,11 @@ | |||
542 | 80 | interfaces = [] | 80 | interfaces = [] |
543 | 81 | 81 | ||
544 | 82 | def __call__(self): | 82 | def __call__(self): |
545 | 83 | import psutil | ||
546 | 84 | multiplier = int(config('worker-multiplier')) or 1 | ||
547 | 85 | ctxt = { | 83 | ctxt = { |
548 | 86 | 'local_ip': unit_private_ip(), | 84 | 'local_ip': unit_private_ip(), |
549 | 87 | 'account_server_port': config('account-server-port'), | 85 | 'account_server_port': config('account-server-port'), |
550 | 88 | 'container_server_port': config('container-server-port'), | 86 | 'container_server_port': config('container-server-port'), |
551 | 89 | 'object_server_port': config('object-server-port'), | 87 | 'object_server_port': config('object-server-port'), |
552 | 90 | 'workers': str(psutil.NUM_CPUS * multiplier), | ||
553 | 91 | 'object_server_threads_per_disk': config( | 88 | 'object_server_threads_per_disk': config( |
554 | 92 | 'object-server-threads-per-disk'), | 89 | 'object-server-threads-per-disk'), |
555 | 93 | 'account_max_connections': config('account-max-connections'), | 90 | 'account_max_connections': config('account-max-connections'), |
556 | 94 | 91 | ||
557 | === modified file 'lib/swift_storage_utils.py' | |||
558 | --- lib/swift_storage_utils.py 2015-11-02 21:40:22 +0000 | |||
559 | +++ lib/swift_storage_utils.py 2016-02-11 16:47:55 +0000 | |||
560 | @@ -132,7 +132,8 @@ | |||
561 | 132 | for server in ['account', 'object', 'container']: | 132 | for server in ['account', 'object', 'container']: |
562 | 133 | configs.register('/etc/swift/%s-server.conf' % server, | 133 | configs.register('/etc/swift/%s-server.conf' % server, |
563 | 134 | [SwiftStorageServerContext(), | 134 | [SwiftStorageServerContext(), |
565 | 135 | context.BindHostContext()]), | 135 | context.BindHostContext(), |
566 | 136 | context.WorkerConfigContext()]), | ||
567 | 136 | return configs | 137 | return configs |
568 | 137 | 138 | ||
569 | 138 | 139 | ||
570 | 139 | 140 | ||
571 | === modified file 'tests/021-basic-xenial-mitaka' (properties changed: -x to +x) | |||
572 | === modified file 'tests/charmhelpers/contrib/openstack/amulet/deployment.py' | |||
573 | --- tests/charmhelpers/contrib/openstack/amulet/deployment.py 2016-01-04 21:31:57 +0000 | |||
574 | +++ tests/charmhelpers/contrib/openstack/amulet/deployment.py 2016-02-11 16:47:55 +0000 | |||
575 | @@ -121,11 +121,12 @@ | |||
576 | 121 | 121 | ||
577 | 122 | # Charms which should use the source config option | 122 | # Charms which should use the source config option |
578 | 123 | use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', | 123 | use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', |
580 | 124 | 'ceph-osd', 'ceph-radosgw'] | 124 | 'ceph-osd', 'ceph-radosgw', 'ceph-mon'] |
581 | 125 | 125 | ||
582 | 126 | # Charms which can not use openstack-origin, ie. many subordinates | 126 | # Charms which can not use openstack-origin, ie. many subordinates |
583 | 127 | no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe', | 127 | no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe', |
585 | 128 | 'openvswitch-odl', 'neutron-api-odl', 'odl-controller'] | 128 | 'openvswitch-odl', 'neutron-api-odl', 'odl-controller', |
586 | 129 | 'cinder-backup'] | ||
587 | 129 | 130 | ||
588 | 130 | if self.openstack: | 131 | if self.openstack: |
589 | 131 | for svc in services: | 132 | for svc in services: |
590 | 132 | 133 | ||
591 | === modified file 'unit_tests/test_swift_storage_context.py' | |||
592 | --- unit_tests/test_swift_storage_context.py 2015-07-17 15:52:38 +0000 | |||
593 | +++ unit_tests/test_swift_storage_context.py 2016-02-11 16:47:55 +0000 | |||
594 | @@ -67,18 +67,15 @@ | |||
595 | 67 | _file.write.assert_called_with('RSYNC_ENABLE=true\n') | 67 | _file.write.assert_called_with('RSYNC_ENABLE=true\n') |
596 | 68 | 68 | ||
597 | 69 | def test_swift_storage_server_context(self): | 69 | def test_swift_storage_server_context(self): |
598 | 70 | import psutil | ||
599 | 71 | self.unit_private_ip.return_value = '10.0.0.5' | 70 | self.unit_private_ip.return_value = '10.0.0.5' |
600 | 72 | self.test_config.set('account-server-port', '500') | 71 | self.test_config.set('account-server-port', '500') |
601 | 73 | self.test_config.set('object-server-port', '501') | 72 | self.test_config.set('object-server-port', '501') |
602 | 74 | self.test_config.set('container-server-port', '502') | 73 | self.test_config.set('container-server-port', '502') |
603 | 75 | self.test_config.set('object-server-threads-per-disk', '3') | 74 | self.test_config.set('object-server-threads-per-disk', '3') |
604 | 76 | self.test_config.set('worker-multiplier', '3') | ||
605 | 77 | self.test_config.set('object-replicator-concurrency', '3') | 75 | self.test_config.set('object-replicator-concurrency', '3') |
606 | 78 | self.test_config.set('account-max-connections', '10') | 76 | self.test_config.set('account-max-connections', '10') |
607 | 79 | self.test_config.set('container-max-connections', '10') | 77 | self.test_config.set('container-max-connections', '10') |
608 | 80 | self.test_config.set('object-max-connections', '10') | 78 | self.test_config.set('object-max-connections', '10') |
609 | 81 | num_workers = psutil.NUM_CPUS * 3 | ||
610 | 82 | ctxt = swift_context.SwiftStorageServerContext() | 79 | ctxt = swift_context.SwiftStorageServerContext() |
611 | 83 | result = ctxt() | 80 | result = ctxt() |
612 | 84 | ex = { | 81 | ex = { |
613 | @@ -87,7 +84,6 @@ | |||
614 | 87 | 'account_server_port': '500', | 84 | 'account_server_port': '500', |
615 | 88 | 'local_ip': '10.0.0.5', | 85 | 'local_ip': '10.0.0.5', |
616 | 89 | 'object_server_threads_per_disk': '3', | 86 | 'object_server_threads_per_disk': '3', |
617 | 90 | 'workers': str(num_workers), | ||
618 | 91 | 'object_replicator_concurrency': '3', | 87 | 'object_replicator_concurrency': '3', |
619 | 92 | 'account_max_connections': '10', | 88 | 'account_max_connections': '10', |
620 | 93 | 'container_max_connections': '10', | 89 | 'container_max_connections': '10', |
621 | 94 | 90 | ||
622 | === modified file 'unit_tests/test_swift_storage_utils.py' | |||
623 | --- unit_tests/test_swift_storage_utils.py 2015-11-16 20:56:57 +0000 | |||
624 | +++ unit_tests/test_swift_storage_utils.py 2016-02-11 16:47:55 +0000 | |||
625 | @@ -292,6 +292,7 @@ | |||
626 | 292 | renderer.assert_called_with(templates_dir=swift_utils.TEMPLATES, | 292 | renderer.assert_called_with(templates_dir=swift_utils.TEMPLATES, |
627 | 293 | openstack_release='essex') | 293 | openstack_release='essex') |
628 | 294 | 294 | ||
629 | 295 | @patch('charmhelpers.contrib.openstack.context.WorkerConfigContext') | ||
630 | 295 | @patch('charmhelpers.contrib.openstack.context.BindHostContext') | 296 | @patch('charmhelpers.contrib.openstack.context.BindHostContext') |
631 | 296 | @patch.object(swift_utils, 'SwiftStorageContext') | 297 | @patch.object(swift_utils, 'SwiftStorageContext') |
632 | 297 | @patch.object(swift_utils, 'RsyncContext') | 298 | @patch.object(swift_utils, 'RsyncContext') |
633 | @@ -299,11 +300,12 @@ | |||
634 | 299 | @patch('charmhelpers.contrib.openstack.templating.OSConfigRenderer') | 300 | @patch('charmhelpers.contrib.openstack.templating.OSConfigRenderer') |
635 | 300 | def test_register_configs_post_install(self, renderer, | 301 | def test_register_configs_post_install(self, renderer, |
636 | 301 | swift, rsync, server, | 302 | swift, rsync, server, |
638 | 302 | bind_context): | 303 | bind_context, worker_context): |
639 | 303 | swift.return_value = 'swift_context' | 304 | swift.return_value = 'swift_context' |
640 | 304 | rsync.return_value = 'rsync_context' | 305 | rsync.return_value = 'rsync_context' |
641 | 305 | server.return_value = 'swift_server_context' | 306 | server.return_value = 'swift_server_context' |
642 | 306 | bind_context.return_value = 'bind_host_context' | 307 | bind_context.return_value = 'bind_host_context' |
643 | 308 | worker_context.return_value = 'worker_context' | ||
644 | 307 | self.get_os_codename_package.return_value = 'grizzly' | 309 | self.get_os_codename_package.return_value = 'grizzly' |
645 | 308 | configs = MagicMock() | 310 | configs = MagicMock() |
646 | 309 | configs.register = MagicMock() | 311 | configs.register = MagicMock() |
647 | @@ -316,11 +318,14 @@ | |||
648 | 316 | call('/etc/rsync-juju.d/050-swift-storage.conf', | 318 | call('/etc/rsync-juju.d/050-swift-storage.conf', |
649 | 317 | ['rsync_context', 'swift_context']), | 319 | ['rsync_context', 'swift_context']), |
650 | 318 | call('/etc/swift/account-server.conf', ['swift_context', | 320 | call('/etc/swift/account-server.conf', ['swift_context', |
652 | 319 | 'bind_host_context']), | 321 | 'bind_host_context', |
653 | 322 | 'worker_context']), | ||
654 | 320 | call('/etc/swift/object-server.conf', ['swift_context', | 323 | call('/etc/swift/object-server.conf', ['swift_context', |
656 | 321 | 'bind_host_context']), | 324 | 'bind_host_context', |
657 | 325 | 'worker_context']), | ||
658 | 322 | call('/etc/swift/container-server.conf', ['swift_context', | 326 | call('/etc/swift/container-server.conf', ['swift_context', |
660 | 323 | 'bind_host_context']) | 327 | 'bind_host_context', |
661 | 328 | 'worker_context']) | ||
662 | 324 | ] | 329 | ] |
663 | 325 | self.assertEquals(ex, configs.register.call_args_list) | 330 | self.assertEquals(ex, configs.register.call_args_list) |
664 | 326 | 331 |
charm_lint_check #18391 swift-storage-next for james-page mp284515
LINT FAIL: lint-test failed
LINT Results (max last 2 lines):
make: *** [lint] Error 1
ERROR:root:Make target returned non-zero.
Full lint test output: http:// paste.ubuntu. com/14731093/ 10.245. 162.77: 8080/job/ charm_lint_ check/18391/
Build: http://