Merge lp:~corey.bryant/nova/2014.1.4 into lp:~ubuntu-server-dev/nova/icehouse
- 2014.1.4
- Merge into icehouse
Proposed by
Corey Bryant
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 700 | ||||
Proposed branch: | lp:~corey.bryant/nova/2014.1.4 | ||||
Merge into: | lp:~ubuntu-server-dev/nova/icehouse | ||||
Diff against target: |
728 lines (+132/-526) 9 files modified
debian/changelog (+56/-0) debian/patches/block-device-mapping-config.patch (+0/-122) debian/patches/cells-json-store.patch (+0/-76) debian/patches/disable-websockify-tests.patch (+25/-0) debian/patches/drop-oslo-utils-usage.patch (+41/-0) debian/patches/fix-requirements.patch (+6/-6) debian/patches/libvirt-Handle-unsupported-host-capabilities.patch (+0/-303) debian/patches/series (+2/-3) debian/patches/update-run-tests.patch (+2/-16) |
||||
To merge this branch: | bzr merge lp:~corey.bryant/nova/2014.1.4 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Page | Needs Fixing | ||
Review via email: mp+253242@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
lp:~corey.bryant/nova/2014.1.4
updated
- 701. By Corey Bryant
-
d/p/update-
run-tests. patch: Run tests with default concurrencey. - 702. By Corey Bryant
-
Update patch description for update-
run-tests. patch
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2014-11-17 17:54:05 +0000 | |||
3 | +++ debian/changelog 2015-03-19 16:31:42 +0000 | |||
4 | @@ -1,3 +1,59 @@ | |||
5 | 1 | nova (1:2014.1.4-0ubuntu1) trusty; urgency=medium | ||
6 | 2 | |||
7 | 3 | * Resynchronize with stable/icehouse (cac6472) (LP: #1432608): | ||
8 | 4 | - [0ff6742] Websocket Proxy should verify Origin header | ||
9 | 5 | - [c70e1fb] Fix kwargs['instance'] KeyError in @reverts_task_state decorator | ||
10 | 6 | - [07ec12c] Revert "Eventlet green threads not released back to pool" | ||
11 | 7 | - [e9cf07b] Compute: Catch binding failed exception while init host | ||
12 | 8 | - [e275961] Make tests use sha256 as openssl default digest algorithm | ||
13 | 9 | - [a657582] Eventlet green threads not released back to pool | ||
14 | 10 | - [4b46a86] Fix image metadata returned for volumes | ||
15 | 11 | - [58a6393] Check min_ram and min_disk when boot from volume | ||
16 | 12 | - [c5411d2] Extends use of ServiceProxy to more methods in HostAPI in cells | ||
17 | 13 | - [1e2abd6] Remove usage of self.__dict__ for message var replacement | ||
18 | 14 | - [54f9225] only emit deprecation warnings once | ||
19 | 15 | - [52103be] Fix disconnecting necessary iSCSI sessions issue | ||
20 | 16 | - [cca94d0] Fix connecting unnecessary iSCSI sessions issue | ||
21 | 17 | - [ac9f5c7] Fix wrong command for _rescan_multipath | ||
22 | 18 | - [d7c8e93] Fix unsafe SSL connection on TrustedFilter | ||
23 | 19 | - [9ecc468] Fix SecurityGroupExists error when booting instances | ||
24 | 20 | - [33be7d7] Update "num_instance" during delete instance | ||
25 | 21 | - [3de3f10] Fix nova evacuate issues for RBD | ||
26 | 22 | - [fe289fb] Fix nova-compute start issue after evacuate | ||
27 | 23 | - [f781656] Add _security_group_ensure_default() DBAPI method | ||
28 | 24 | - [8812672] Run build_and_run_instance in a separate greenthread | ||
29 | 25 | - [b6a080b] Fixes DOS issue in instance list ip filter | ||
30 | 26 | - [5ab0421] Make the block device mapping retries configurable | ||
31 | 27 | - [0695e14] Retry on closing of luks encrypted volume in case device is busy | ||
32 | 28 | - [dffa810] Add @_retry_on_deadlock to _instance_update() | ||
33 | 29 | - [f086ca3] Nova api service doesn't handle SIGHUP properly | ||
34 | 30 | - [7cdb643] Fix XML UnicodeEncode serialization error | ||
35 | 31 | - [98a6c1e] postgresql: use postgres db instead of template1 | ||
36 | 32 | - [155664f] share neutron admin auth tokens | ||
37 | 33 | - [3e80433] VMware: validate that VM exists on backend prior to deletion | ||
38 | 34 | - [d71445c] VMWare: Fix VM leak when deletion of VM during resizing | ||
39 | 35 | - [56b62b7] Sync process utils from oslo | ||
40 | 36 | - [ddd62ff] VMware: prevent race condition with VNC port allocation | ||
41 | 37 | - [4174130] Fixes Hyper-V volume mapping issue on reboot | ||
42 | 38 | - [bfeae68] Fix CellStateManagerFile init to failure | ||
43 | 39 | - [5ec3cd3] Raise descriptive error for over volume quota | ||
44 | 40 | - [f9fad7a] Fixes missing ec2 api address disassociate error on failure | ||
45 | 41 | - [64ec1bf] Fix instance cross AZ check when attaching volumes | ||
46 | 42 | - [698c821] Ignore errors when deleting non-existing vifs | ||
47 | 43 | - [8141e7a] libvirt: Handle unsupported host capabilities | ||
48 | 44 | - [df9ead9] libvirt: Make `fakelibvirt.libvirtError` match | ||
49 | 45 | - [cac6472] Add _wrap_db_error() support to SessionTransaction.commit() | ||
50 | 46 | * d/p/drop-oslo-utils-usage.patch: Added to override new oslo.utils dep. | ||
51 | 47 | * d/p/disable-websockify-tests.patch: Added to disable websockify tests. | ||
52 | 48 | * d/p/block-device-mapping-config.patch: Dropped. Fixed upstream in [5ab0421]. | ||
53 | 49 | * d/p/libvirt-Handle-unsupported-host-capabilities.patch: Dropped. Fixed | ||
54 | 50 | upstream in [8141e7a] and [df9ead9]. | ||
55 | 51 | * d/p/cells-json-store.patch: Dropped. Fixed upstream in [bfeae68]. | ||
56 | 52 | * d/p/fix-requirements.patch: Rebased. | ||
57 | 53 | * d/p/update-run-tests.patch: Run tests with default concurrencey. | ||
58 | 54 | |||
59 | 55 | -- Corey Bryant <corey.bryant@canonical.com> Mon, 16 Mar 2015 08:29:39 -0400 | ||
60 | 56 | |||
61 | 1 | nova (1:2014.1.3-0ubuntu2) trusty; urgency=medium | 57 | nova (1:2014.1.3-0ubuntu2) trusty; urgency=medium |
62 | 2 | 58 | ||
63 | 3 | [ Corey Bryant ] | 59 | [ Corey Bryant ] |
64 | 4 | 60 | ||
65 | === removed file 'debian/patches/block-device-mapping-config.patch' | |||
66 | --- debian/patches/block-device-mapping-config.patch 2014-11-10 16:31:07 +0000 | |||
67 | +++ debian/patches/block-device-mapping-config.patch 1970-01-01 00:00:00 +0000 | |||
68 | @@ -1,122 +0,0 @@ | |||
69 | 1 | Description: Make the block device mapping retries configurable | ||
70 | 2 | Author: Akash Gangil <akashg1611@gmail.com> | ||
71 | 3 | Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nova/+bug/1376927 | ||
72 | 4 | Forwarded: https://review.openstack.org/#/c/129276/ | ||
73 | 5 | diff --git a/nova/compute/manager.py b/nova/compute/manager.py | ||
74 | 6 | index 260a2b7..45e143c 100644 | ||
75 | 7 | --- a/nova/compute/manager.py | ||
76 | 8 | +++ b/nova/compute/manager.py | ||
77 | 9 | @@ -120,6 +120,10 @@ compute_opts = [ | ||
78 | 10 | cfg.IntOpt('network_allocate_retries', | ||
79 | 11 | default=0, | ||
80 | 12 | help="Number of times to retry network allocation on failures"), | ||
81 | 13 | + cfg.IntOpt('block_device_allocate_retries', | ||
82 | 14 | + default=180, | ||
83 | 15 | + help='Number of times to retry block device' | ||
84 | 16 | + ' allocation on failures') | ||
85 | 17 | ] | ||
86 | 18 | |||
87 | 19 | interval_opts = [ | ||
88 | 20 | @@ -153,7 +157,11 @@ interval_opts = [ | ||
89 | 21 | cfg.IntOpt('instance_delete_interval', | ||
90 | 22 | default=300, | ||
91 | 23 | help=('Interval in seconds for retrying failed instance file ' | ||
92 | 24 | - 'deletes')) | ||
93 | 25 | + 'deletes')), | ||
94 | 26 | + cfg.IntOpt('block_device_allocate_retries_interval', | ||
95 | 27 | + default=1, | ||
96 | 28 | + help='Waiting time interval (seconds) between block' | ||
97 | 29 | + ' device allocation retries on failures') | ||
98 | 30 | ] | ||
99 | 31 | |||
100 | 32 | timeout_opts = [ | ||
101 | 33 | @@ -1135,24 +1143,21 @@ class ComputeManager(manager.Manager): | ||
102 | 34 | instance) | ||
103 | 35 | return network_info | ||
104 | 36 | |||
105 | 37 | - def _await_block_device_map_created(self, context, vol_id, max_tries=180, | ||
106 | 38 | - wait_between=1): | ||
107 | 39 | + def _await_block_device_map_created(self, context, vol_id): | ||
108 | 40 | # TODO(yamahata): creating volume simultaneously | ||
109 | 41 | # reduces creation time? | ||
110 | 42 | # TODO(yamahata): eliminate dumb polling | ||
111 | 43 | - # TODO(harlowja): make the max_tries configurable or dynamic? | ||
112 | 44 | attempts = 0 | ||
113 | 45 | start = time.time() | ||
114 | 46 | - while attempts < max_tries: | ||
115 | 47 | + while attempts < CONF.block_device_allocate_retries: | ||
116 | 48 | volume = self.volume_api.get(context, vol_id) | ||
117 | 49 | volume_status = volume['status'] | ||
118 | 50 | if volume_status not in ['creating', 'downloading']: | ||
119 | 51 | if volume_status != 'available': | ||
120 | 52 | LOG.warn(_("Volume id: %s finished being created but was" | ||
121 | 53 | " not set as 'available'"), vol_id) | ||
122 | 54 | - # NOTE(harlowja): return how many attempts were tried | ||
123 | 55 | return attempts + 1 | ||
124 | 56 | - greenthread.sleep(wait_between) | ||
125 | 57 | + greenthread.sleep(CONF.block_device_allocate_retries_interval) | ||
126 | 58 | attempts += 1 | ||
127 | 59 | # NOTE(harlowja): Should only happen if we ran out of attempts | ||
128 | 60 | raise exception.VolumeNotCreated(volume_id=vol_id, | ||
129 | 61 | diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py | ||
130 | 62 | index f1e334d..81765b4 100644 | ||
131 | 63 | --- a/nova/tests/compute/test_compute.py | ||
132 | 64 | +++ b/nova/tests/compute/test_compute.py | ||
133 | 65 | @@ -34,6 +34,8 @@ from oslo import messaging | ||
134 | 66 | import six | ||
135 | 67 | from testtools import matchers as testtools_matchers | ||
136 | 68 | |||
137 | 69 | +from eventlet import greenthread | ||
138 | 70 | + | ||
139 | 71 | import nova | ||
140 | 72 | from nova import availability_zones | ||
141 | 73 | from nova import block_device | ||
142 | 74 | @@ -378,6 +380,8 @@ class ComputeVolumeTestCase(BaseTestCase): | ||
143 | 75 | lambda *a, **kw: None) | ||
144 | 76 | self.stubs.Set(self.compute.volume_api, 'check_attach', | ||
145 | 77 | lambda *a, **kw: None) | ||
146 | 78 | + self.stubs.Set(greenthread, 'sleep', | ||
147 | 79 | + lambda *a, **kw: None) | ||
148 | 80 | |||
149 | 81 | def store_cinfo(context, *args, **kwargs): | ||
150 | 82 | self.cinfo = jsonutils.loads(args[-1].get('connection_info')) | ||
151 | 83 | @@ -438,7 +442,9 @@ class ComputeVolumeTestCase(BaseTestCase): | ||
152 | 84 | mock_get_by_id.assert_called_once_with(self.context, 'fake') | ||
153 | 85 | self.assertTrue(mock_attach.called) | ||
154 | 86 | |||
155 | 87 | - def test_await_block_device_created_to_slow(self): | ||
156 | 88 | + def test_await_block_device_created_too_slow(self): | ||
157 | 89 | + self.flags(block_device_allocate_retries=2) | ||
158 | 90 | + self.flags(block_device_allocate_retries_interval=0.1) | ||
159 | 91 | |||
160 | 92 | def never_get(context, vol_id): | ||
161 | 93 | return { | ||
162 | 94 | @@ -449,13 +455,15 @@ class ComputeVolumeTestCase(BaseTestCase): | ||
163 | 95 | self.stubs.Set(self.compute.volume_api, 'get', never_get) | ||
164 | 96 | self.assertRaises(exception.VolumeNotCreated, | ||
165 | 97 | self.compute._await_block_device_map_created, | ||
166 | 98 | - self.context, '1', max_tries=2, wait_between=0.1) | ||
167 | 99 | + self.context, '1') | ||
168 | 100 | |||
169 | 101 | def test_await_block_device_created_slow(self): | ||
170 | 102 | c = self.compute | ||
171 | 103 | + self.flags(block_device_allocate_retries=4) | ||
172 | 104 | + self.flags(block_device_allocate_retries_interval=0.1) | ||
173 | 105 | |||
174 | 106 | def slow_get(context, vol_id): | ||
175 | 107 | - while self.fetched_attempts < 2: | ||
176 | 108 | + if self.fetched_attempts < 2: | ||
177 | 109 | self.fetched_attempts += 1 | ||
178 | 110 | return { | ||
179 | 111 | 'status': 'creating', | ||
180 | 112 | @@ -467,9 +475,7 @@ class ComputeVolumeTestCase(BaseTestCase): | ||
181 | 113 | } | ||
182 | 114 | |||
183 | 115 | self.stubs.Set(c.volume_api, 'get', slow_get) | ||
184 | 116 | - attempts = c._await_block_device_map_created(self.context, '1', | ||
185 | 117 | - max_tries=4, | ||
186 | 118 | - wait_between=0.1) | ||
187 | 119 | + attempts = c._await_block_device_map_created(self.context, '1') | ||
188 | 120 | self.assertEqual(attempts, 3) | ||
189 | 121 | |||
190 | 122 | def test_boot_volume_serial(self): | ||
191 | 123 | 0 | ||
192 | === removed file 'debian/patches/cells-json-store.patch' | |||
193 | --- debian/patches/cells-json-store.patch 2014-09-30 09:25:52 +0000 | |||
194 | +++ debian/patches/cells-json-store.patch 1970-01-01 00:00:00 +0000 | |||
195 | @@ -1,76 +0,0 @@ | |||
196 | 1 | Description: Fix nova cells failing with a json topology file bug | ||
197 | 2 | Author: Liam Young <liam.young@canonical.com> | ||
198 | 3 | Bug: https://bugs.launchpad.net/nova/+bug/1314677 | ||
199 | 4 | Forwarded: https://review.openstack.org/#/c/124811/ | ||
200 | 5 | diff --git a/nova/cells/state.py b/nova/cells/state.py | ||
201 | 6 | index b9112bd..1e12450 100644 | ||
202 | 7 | --- a/nova/cells/state.py | ||
203 | 8 | +++ b/nova/cells/state.py | ||
204 | 9 | @@ -152,10 +152,7 @@ class CellStateManager(base.Base): | ||
205 | 10 | cells_config = CONF.cells.cells_config | ||
206 | 11 | |||
207 | 12 | if cells_config: | ||
208 | 13 | - config_path = CONF.find_file(cells_config) | ||
209 | 14 | - if not config_path: | ||
210 | 15 | - raise cfg.ConfigFilesNotFoundError(config_files=[cells_config]) | ||
211 | 16 | - return CellStateManagerFile(cell_state_cls, config_path) | ||
212 | 17 | + return CellStateManagerFile(cell_state_cls) | ||
213 | 18 | |||
214 | 19 | return CellStateManagerDB(cell_state_cls) | ||
215 | 20 | |||
216 | 21 | @@ -450,8 +447,11 @@ class CellStateManagerDB(CellStateManager): | ||
217 | 22 | |||
218 | 23 | |||
219 | 24 | class CellStateManagerFile(CellStateManager): | ||
220 | 25 | - def __init__(self, cell_state_cls, cells_config_path): | ||
221 | 26 | - self.cells_config_path = cells_config_path | ||
222 | 27 | + def __init__(self, cell_state_cls=None): | ||
223 | 28 | + cells_config = CONF.cells.cells_config | ||
224 | 29 | + self.cells_config_path = CONF.find_file(cells_config) | ||
225 | 30 | + if not self.cells_config_path: | ||
226 | 31 | + raise cfg.ConfigFilesNotFoundError(config_files=[cells_config]) | ||
227 | 32 | super(CellStateManagerFile, self).__init__(cell_state_cls) | ||
228 | 33 | |||
229 | 34 | def _cell_data_sync(self, force=False): | ||
230 | 35 | diff --git a/nova/tests/cells/test_cells_state_manager.py b/nova/tests/cells/test_cells_state_manager.py | ||
231 | 36 | index 1c29927..4841e14 100644 | ||
232 | 37 | --- a/nova/tests/cells/test_cells_state_manager.py | ||
233 | 38 | +++ b/nova/tests/cells/test_cells_state_manager.py | ||
234 | 39 | @@ -16,12 +16,16 @@ | ||
235 | 40 | Tests For CellStateManager | ||
236 | 41 | """ | ||
237 | 42 | |||
238 | 43 | +import mock | ||
239 | 44 | +import six | ||
240 | 45 | + | ||
241 | 46 | from oslo.config import cfg | ||
242 | 47 | |||
243 | 48 | from nova.cells import state | ||
244 | 49 | from nova import db | ||
245 | 50 | from nova.db.sqlalchemy import models | ||
246 | 51 | from nova import exception | ||
247 | 52 | +from nova.openstack.common import fileutils | ||
248 | 53 | from nova import test | ||
249 | 54 | |||
250 | 55 | |||
251 | 56 | @@ -78,6 +82,19 @@ class TestCellsStateManager(test.TestCase): | ||
252 | 57 | state.CellStateManager) | ||
253 | 58 | self.assertEqual(['no_such_file_exists.conf'], e.config_files) | ||
254 | 59 | |||
255 | 60 | + @mock.patch.object(cfg.ConfigOpts, 'find_file') | ||
256 | 61 | + @mock.patch.object(fileutils, 'read_cached_file') | ||
257 | 62 | + def test_filemanager_returned(self, mock_read_cached_file, mock_find_file): | ||
258 | 63 | + mock_find_file.return_value = "/etc/nova/cells.json" | ||
259 | 64 | + mock_read_cached_file.return_value = (False, six.StringIO({})) | ||
260 | 65 | + self.flags(cells_config='cells.json', group='cells') | ||
261 | 66 | + self.assertIsInstance(state.CellStateManager(), | ||
262 | 67 | + state.CellStateManagerFile) | ||
263 | 68 | + | ||
264 | 69 | + def test_dbmanager_returned(self): | ||
265 | 70 | + self.assertIsInstance(state.CellStateManager(), | ||
266 | 71 | + state.CellStateManagerDB) | ||
267 | 72 | + | ||
268 | 73 | def test_capacity_no_reserve(self): | ||
269 | 74 | # utilize entire cell | ||
270 | 75 | cap = self._capacity(0.0) | ||
271 | 76 | |||
272 | 77 | 0 | ||
273 | === added file 'debian/patches/disable-websockify-tests.patch' | |||
274 | --- debian/patches/disable-websockify-tests.patch 1970-01-01 00:00:00 +0000 | |||
275 | +++ debian/patches/disable-websockify-tests.patch 2015-03-19 16:31:42 +0000 | |||
276 | @@ -0,0 +1,25 @@ | |||
277 | 1 | --- a/nova/tests/console/test_websocketproxy.py | ||
278 | 2 | +++ b/nova/tests/console/test_websocketproxy.py | ||
279 | 3 | @@ -16,8 +16,13 @@ | ||
280 | 4 | |||
281 | 5 | |||
282 | 6 | import mock | ||
283 | 7 | +import testtools | ||
284 | 8 | + | ||
285 | 9 | +try: | ||
286 | 10 | + from nova.console import websocketproxy | ||
287 | 11 | +except: | ||
288 | 12 | + websocketproxy = None | ||
289 | 13 | |||
290 | 14 | -from nova.console import websocketproxy | ||
291 | 15 | from nova import exception | ||
292 | 16 | from nova import test | ||
293 | 17 | from oslo.config import cfg | ||
294 | 18 | @@ -27,6 +32,7 @@ | ||
295 | 19 | |||
296 | 20 | class NovaProxyRequestHandlerBaseTestCase(test.TestCase): | ||
297 | 21 | |||
298 | 22 | + @testtools.skipIf(websocketproxy is None, "websockify not available") | ||
299 | 23 | def setUp(self): | ||
300 | 24 | super(NovaProxyRequestHandlerBaseTestCase, self).setUp() | ||
301 | 25 | |||
302 | 0 | 26 | ||
303 | === added file 'debian/patches/drop-oslo-utils-usage.patch' | |||
304 | --- debian/patches/drop-oslo-utils-usage.patch 1970-01-01 00:00:00 +0000 | |||
305 | +++ debian/patches/drop-oslo-utils-usage.patch 2015-03-19 16:31:42 +0000 | |||
306 | @@ -0,0 +1,41 @@ | |||
307 | 1 | Description: Override python-oslo.utils dependency as it's not in trusty. | ||
308 | 2 | Author: Corey Bryant <corey.bryant@canonical.com> | ||
309 | 3 | Bug: https://bugs.launchpad.net/bugs/1432685 | ||
310 | 4 | Forwarded: yes | ||
311 | 5 | |||
312 | 6 | --- a/nova/compute/api.py | ||
313 | 7 | +++ b/nova/compute/api.py | ||
314 | 8 | @@ -26,7 +26,6 @@ | ||
315 | 9 | import uuid | ||
316 | 10 | |||
317 | 11 | from oslo.config import cfg | ||
318 | 12 | -from oslo.utils import units | ||
319 | 13 | import six | ||
320 | 14 | |||
321 | 15 | from nova import availability_zones | ||
322 | 16 | @@ -68,6 +67,7 @@ | ||
323 | 17 | from nova.openstack.common import log as logging | ||
324 | 18 | from nova.openstack.common import strutils | ||
325 | 19 | from nova.openstack.common import timeutils | ||
326 | 20 | +from nova.openstack.common import units | ||
327 | 21 | from nova.openstack.common import uuidutils | ||
328 | 22 | import nova.policy | ||
329 | 23 | from nova import quota | ||
330 | 24 | --- a/nova/tests/compute/test_compute.py | ||
331 | 25 | +++ b/nova/tests/compute/test_compute.py | ||
332 | 26 | @@ -31,7 +31,6 @@ | ||
333 | 27 | import mox | ||
334 | 28 | from oslo.config import cfg | ||
335 | 29 | from oslo import messaging | ||
336 | 30 | -from oslo.utils import units | ||
337 | 31 | import six | ||
338 | 32 | from testtools import matchers as testtools_matchers | ||
339 | 33 | |||
340 | 34 | @@ -69,6 +68,7 @@ | ||
341 | 35 | from nova.openstack.common import jsonutils | ||
342 | 36 | from nova.openstack.common import log as logging | ||
343 | 37 | from nova.openstack.common import timeutils | ||
344 | 38 | +from nova.openstack.common import units | ||
345 | 39 | from nova.openstack.common import uuidutils | ||
346 | 40 | from nova import policy | ||
347 | 41 | from nova import quota | ||
348 | 0 | 42 | ||
349 | === modified file 'debian/patches/fix-requirements.patch' | |||
350 | --- debian/patches/fix-requirements.patch 2014-08-08 17:43:35 +0000 | |||
351 | +++ debian/patches/fix-requirements.patch 2015-03-19 16:31:42 +0000 | |||
352 | @@ -4,13 +4,13 @@ | |||
353 | 4 | --- a/requirements.txt | 4 | --- a/requirements.txt |
354 | 5 | +++ b/requirements.txt | 5 | +++ b/requirements.txt |
355 | 6 | @@ -25,9 +25,8 @@ | 6 | @@ -25,9 +25,8 @@ |
359 | 7 | python-neutronclient>=2.3.4,<3 | 7 | python-neutronclient>=2.3.4,<2.3.11 |
360 | 8 | python-glanceclient>=0.9.0 | 8 | python-glanceclient>=0.9.0,!=0.14.0,<=0.14.2 |
361 | 9 | python-keystoneclient>=0.7.0 | 9 | python-keystoneclient>=0.7.0,<=0.11.2 |
362 | 10 | -six>=1.6.0 | 10 | -six>=1.6.0 |
363 | 11 | +six>=1.5.2 | 11 | +six>=1.5.2 |
365 | 12 | stevedore>=0.14 | 12 | stevedore>=0.14,<1.2 |
366 | 13 | -websockify>=0.5.1,<0.6 | 13 | -websockify>=0.5.1,<0.6 |
367 | 14 | wsgiref>=0.1.2 | 14 | wsgiref>=0.1.2 |
370 | 15 | oslo.config>=1.2.0 | 15 | oslo.config>=1.2.0,<1.5 |
371 | 16 | oslo.rootwrap | 16 | oslo.rootwrap<1.4 |
372 | 17 | 17 | ||
373 | === removed file 'debian/patches/libvirt-Handle-unsupported-host-capabilities.patch' | |||
374 | --- debian/patches/libvirt-Handle-unsupported-host-capabilities.patch 2014-10-03 17:24:01 +0000 | |||
375 | +++ debian/patches/libvirt-Handle-unsupported-host-capabilities.patch 1970-01-01 00:00:00 +0000 | |||
376 | @@ -1,303 +0,0 @@ | |||
377 | 1 | Description: Fix exception when starting LXC containers with libvirt-lxc. | ||
378 | 2 | Author: Chuck Short <zulcss@ubuntu.com> | ||
379 | 3 | Forwarded: Not Needed. | ||
380 | 4 | --- a/nova/tests/virt/libvirt/fakelibvirt.py | ||
381 | 5 | +++ b/nova/tests/virt/libvirt/fakelibvirt.py | ||
382 | 6 | @@ -172,18 +172,76 @@ | ||
383 | 7 | |||
384 | 8 | |||
385 | 9 | class libvirtError(Exception): | ||
386 | 10 | - def __init__(self, msg, | ||
387 | 11 | - error_code=VIR_ERR_INTERNAL_ERROR, | ||
388 | 12 | - error_domain=VIR_FROM_QEMU): | ||
389 | 13 | - self.error_code = error_code | ||
390 | 14 | - self.error_domain = error_domain | ||
391 | 15 | - Exception(self, msg) | ||
392 | 16 | + """This class was copied and slightly modified from | ||
393 | 17 | + `libvirt-python:libvirt-override.py`. | ||
394 | 18 | + | ||
395 | 19 | + Since a test environment will use the real `libvirt-python` version of | ||
396 | 20 | + `libvirtError` if it's installed and not this fake, we need to maintain | ||
397 | 21 | + strict compatability with the original class, including `__init__` args | ||
398 | 22 | + and instance-attributes. | ||
399 | 23 | + | ||
400 | 24 | + To create a libvirtError instance you should: | ||
401 | 25 | + | ||
402 | 26 | + # Create an unsupported error exception | ||
403 | 27 | + exc = libvirtError('my message') | ||
404 | 28 | + exc.err = (libvirt.VIR_ERR_NO_SUPPORT,) | ||
405 | 29 | + | ||
406 | 30 | + self.err is a tuple of form: | ||
407 | 31 | + (error_code, error_domain, error_message, error_level, str1, str2, | ||
408 | 32 | + str3, int1, int2) | ||
409 | 33 | + | ||
410 | 34 | + Alternatively, you can use the `make_libvirtError` convenience function to | ||
411 | 35 | + allow you to specify these attributes in one shot. | ||
412 | 36 | + """ | ||
413 | 37 | + def __init__(self, defmsg, conn=None, dom=None, net=None, pool=None, | ||
414 | 38 | + vol=None): | ||
415 | 39 | + Exception.__init__(self, defmsg) | ||
416 | 40 | + self.err = None | ||
417 | 41 | |||
418 | 42 | def get_error_code(self): | ||
419 | 43 | - return self.error_code | ||
420 | 44 | + if self.err is None: | ||
421 | 45 | + return None | ||
422 | 46 | + return self.err[0] | ||
423 | 47 | |||
424 | 48 | def get_error_domain(self): | ||
425 | 49 | - return self.error_domain | ||
426 | 50 | + if self.err is None: | ||
427 | 51 | + return None | ||
428 | 52 | + return self.err[1] | ||
429 | 53 | + | ||
430 | 54 | + def get_error_message(self): | ||
431 | 55 | + if self.err is None: | ||
432 | 56 | + return None | ||
433 | 57 | + return self.err[2] | ||
434 | 58 | + | ||
435 | 59 | + def get_error_level(self): | ||
436 | 60 | + if self.err is None: | ||
437 | 61 | + return None | ||
438 | 62 | + return self.err[3] | ||
439 | 63 | + | ||
440 | 64 | + def get_str1(self): | ||
441 | 65 | + if self.err is None: | ||
442 | 66 | + return None | ||
443 | 67 | + return self.err[4] | ||
444 | 68 | + | ||
445 | 69 | + def get_str2(self): | ||
446 | 70 | + if self.err is None: | ||
447 | 71 | + return None | ||
448 | 72 | + return self.err[5] | ||
449 | 73 | + | ||
450 | 74 | + def get_str3(self): | ||
451 | 75 | + if self.err is None: | ||
452 | 76 | + return None | ||
453 | 77 | + return self.err[6] | ||
454 | 78 | + | ||
455 | 79 | + def get_int1(self): | ||
456 | 80 | + if self.err is None: | ||
457 | 81 | + return None | ||
458 | 82 | + return self.err[7] | ||
459 | 83 | + | ||
460 | 84 | + def get_int2(self): | ||
461 | 85 | + if self.err is None: | ||
462 | 86 | + return None | ||
463 | 87 | + return self.err[8] | ||
464 | 88 | |||
465 | 89 | |||
466 | 90 | class NWFilter(object): | ||
467 | 91 | @@ -219,8 +277,10 @@ | ||
468 | 92 | try: | ||
469 | 93 | tree = etree.fromstring(xml) | ||
470 | 94 | except etree.ParseError: | ||
471 | 95 | - raise libvirtError("Invalid XML.", | ||
472 | 96 | - VIR_ERR_XML_DETAIL, VIR_FROM_DOMAIN) | ||
473 | 97 | + raise make_libvirtError( | ||
474 | 98 | + libvirtError, "Invalid XML.", | ||
475 | 99 | + error_code=VIR_ERR_XML_DETAIL, | ||
476 | 100 | + error_domain=VIR_FROM_DOMAIN) | ||
477 | 101 | |||
478 | 102 | definition = {} | ||
479 | 103 | |||
480 | 104 | @@ -369,7 +429,11 @@ | ||
481 | 105 | 123456789L] | ||
482 | 106 | |||
483 | 107 | def migrateToURI(self, desturi, flags, dname, bandwidth): | ||
484 | 108 | - raise libvirtError("Migration always fails for fake libvirt!") | ||
485 | 109 | + raise make_libvirtError( | ||
486 | 110 | + libvirtError, | ||
487 | 111 | + "Migration always fails for fake libvirt!", | ||
488 | 112 | + error_code=VIR_ERR_INTERNAL_ERROR, | ||
489 | 113 | + error_domain=VIR_FROM_QEMU) | ||
490 | 114 | |||
491 | 115 | def attachDevice(self, xml): | ||
492 | 116 | disk_info = _parse_disk_info(etree.fromstring(xml)) | ||
493 | 117 | @@ -380,7 +444,11 @@ | ||
494 | 118 | def attachDeviceFlags(self, xml, flags): | ||
495 | 119 | if (flags & VIR_DOMAIN_AFFECT_LIVE and | ||
496 | 120 | self._state != VIR_DOMAIN_RUNNING): | ||
497 | 121 | - raise libvirtError("AFFECT_LIVE only allowed for running domains!") | ||
498 | 122 | + raise make_libvirtError( | ||
499 | 123 | + libvirtError, | ||
500 | 124 | + "AFFECT_LIVE only allowed for running domains!", | ||
501 | 125 | + error_code=VIR_ERR_INTERNAL_ERROR, | ||
502 | 126 | + error_domain=VIR_FROM_QEMU) | ||
503 | 127 | self.attachDevice(xml) | ||
504 | 128 | |||
505 | 129 | def detachDevice(self, xml): | ||
506 | 130 | @@ -533,9 +601,11 @@ | ||
507 | 131 | 'test:///default'] | ||
508 | 132 | |||
509 | 133 | if uri not in uri_whitelist: | ||
510 | 134 | - raise libvirtError("libvirt error: no connection driver " | ||
511 | 135 | - "available for No connection for URI %s" % uri, | ||
512 | 136 | - 5, 0) | ||
513 | 137 | + raise make_libvirtError( | ||
514 | 138 | + libvirtError, | ||
515 | 139 | + "libvirt error: no connection driver " | ||
516 | 140 | + "available for No connection for URI %s" % uri, | ||
517 | 141 | + error_code=5, error_domain=0) | ||
518 | 142 | |||
519 | 143 | self.readonly = readonly | ||
520 | 144 | self._uri = uri | ||
521 | 145 | @@ -594,16 +664,20 @@ | ||
522 | 146 | def lookupByID(self, id): | ||
523 | 147 | if id in self._running_vms: | ||
524 | 148 | return self._running_vms[id] | ||
525 | 149 | - raise libvirtError('Domain not found: no domain with matching ' | ||
526 | 150 | - 'id %d' % id, | ||
527 | 151 | - VIR_ERR_NO_DOMAIN, VIR_FROM_QEMU) | ||
528 | 152 | + raise make_libvirtError( | ||
529 | 153 | + libvirtError, | ||
530 | 154 | + 'Domain not found: no domain with matching id %d' % id, | ||
531 | 155 | + error_code=VIR_ERR_NO_DOMAIN, | ||
532 | 156 | + error_domain=VIR_FROM_QEMU) | ||
533 | 157 | |||
534 | 158 | def lookupByName(self, name): | ||
535 | 159 | if name in self._vms: | ||
536 | 160 | return self._vms[name] | ||
537 | 161 | - raise libvirtError('Domain not found: no domain with matching ' | ||
538 | 162 | - 'name "%s"' % name, | ||
539 | 163 | - VIR_ERR_NO_DOMAIN, VIR_FROM_QEMU) | ||
540 | 164 | + raise make_libvirtError( | ||
541 | 165 | + libvirtError, | ||
542 | 166 | + 'Domain not found: no domain with matching name "%s"' % name, | ||
543 | 167 | + error_code=VIR_ERR_NO_DOMAIN, | ||
544 | 168 | + error_domain=VIR_FROM_QEMU) | ||
545 | 169 | |||
546 | 170 | def _emit_lifecycle(self, dom, event, detail): | ||
547 | 171 | if VIR_DOMAIN_EVENT_ID_LIFECYCLE not in self._event_callbacks: | ||
548 | 172 | @@ -904,14 +978,21 @@ | ||
549 | 173 | 'user': 26728850000000L, | ||
550 | 174 | 'iowait': 6121490000000L} | ||
551 | 175 | else: | ||
552 | 176 | - raise libvirtError("invalid argument: Invalid cpu number") | ||
553 | 177 | + raise make_libvirtError( | ||
554 | 178 | + libvirtError, | ||
555 | 179 | + "invalid argument: Invalid cpu number", | ||
556 | 180 | + error_code=VIR_ERR_INTERNAL_ERROR, | ||
557 | 181 | + error_domain=VIR_FROM_QEMU) | ||
558 | 182 | |||
559 | 183 | def nwfilterLookupByName(self, name): | ||
560 | 184 | try: | ||
561 | 185 | return self._nwfilters[name] | ||
562 | 186 | except KeyError: | ||
563 | 187 | - raise libvirtError("no nwfilter with matching name %s" % name, | ||
564 | 188 | - VIR_ERR_NO_NWFILTER, VIR_FROM_NWFILTER) | ||
565 | 189 | + raise make_libvirtError( | ||
566 | 190 | + libvirtError, | ||
567 | 191 | + "no nwfilter with matching name %s" % name, | ||
568 | 192 | + error_code=VIR_ERR_NO_NWFILTER, | ||
569 | 193 | + error_domain=VIR_FROM_NWFILTER) | ||
570 | 194 | |||
571 | 195 | def nwfilterDefineXML(self, xml): | ||
572 | 196 | nwfilter = NWFilter(self, xml) | ||
573 | 197 | @@ -964,6 +1045,24 @@ | ||
574 | 198 | pass | ||
575 | 199 | |||
576 | 200 | |||
577 | 201 | +def make_libvirtError(error_class, msg, error_code=None, | ||
578 | 202 | + error_domain=None, error_message=None, | ||
579 | 203 | + error_level=None, str1=None, str2=None, str3=None, | ||
580 | 204 | + int1=None, int2=None): | ||
581 | 205 | + """Convenience function for creating `libvirtError` exceptions which | ||
582 | 206 | + allow you to specify arguments in constructor without having to manipulate | ||
583 | 207 | + the `err` tuple directly. | ||
584 | 208 | + | ||
585 | 209 | + We need to pass in `error_class` to this function because it may be | ||
586 | 210 | + `libvirt.libvirtError` or `fakelibvirt.libvirtError` depending on whether | ||
587 | 211 | + `libvirt-python` is installed. | ||
588 | 212 | + """ | ||
589 | 213 | + exc = error_class(msg) | ||
590 | 214 | + exc.err = (error_code, error_domain, error_message, error_level, | ||
591 | 215 | + str1, str2, str3, int1, int2) | ||
592 | 216 | + return exc | ||
593 | 217 | + | ||
594 | 218 | + | ||
595 | 219 | virDomain = Domain | ||
596 | 220 | |||
597 | 221 | |||
598 | 222 | --- a/nova/virt/libvirt/driver.py | ||
599 | 223 | +++ b/nova/virt/libvirt/driver.py | ||
600 | 224 | @@ -77,6 +77,7 @@ | ||
601 | 225 | from nova.openstack.common import excutils | ||
602 | 226 | from nova.openstack.common import fileutils | ||
603 | 227 | from nova.openstack.common.gettextutils import _ | ||
604 | 228 | +from nova.openstack.common.gettextutils import _LW | ||
605 | 229 | from nova.openstack.common import importutils | ||
606 | 230 | from nova.openstack.common import jsonutils | ||
607 | 231 | from nova.openstack.common import log as logging | ||
608 | 232 | @@ -2888,9 +2889,14 @@ | ||
609 | 233 | # this -1 checking should be removed later. | ||
610 | 234 | if features and features != -1: | ||
611 | 235 | self._caps.host.cpu.parse_str(features) | ||
612 | 236 | - except libvirt.VIR_ERR_NO_SUPPORT: | ||
613 | 237 | - # Note(yjiang5): ignore if libvirt has no support | ||
614 | 238 | - pass | ||
615 | 239 | + except libvirt.libvirtError as ex: | ||
616 | 240 | + error_code = ex.get_error_code() | ||
617 | 241 | + if error_code == libvirt.VIR_ERR_NO_SUPPORT: | ||
618 | 242 | + LOG.warn(_LW("URI %(uri)s does not support full set" | ||
619 | 243 | + " of host capabilities: " "%(error)s"), | ||
620 | 244 | + {'uri': self.uri(), 'error': ex}) | ||
621 | 245 | + else: | ||
622 | 246 | + raise | ||
623 | 247 | return self._caps | ||
624 | 248 | |||
625 | 249 | def get_host_uuid(self): | ||
626 | 250 | --- a/nova/tests/virt/libvirt/test_libvirt.py | ||
627 | 251 | +++ b/nova/tests/virt/libvirt/test_libvirt.py | ||
628 | 252 | @@ -83,7 +83,7 @@ | ||
629 | 253 | try: | ||
630 | 254 | import libvirt | ||
631 | 255 | except ImportError: | ||
632 | 256 | - import nova.tests.virt.libvirt.fakelibvirt as libvirt | ||
633 | 257 | + libvirt = fakelibvirt | ||
634 | 258 | libvirt_driver.libvirt = libvirt | ||
635 | 259 | |||
636 | 260 | |||
637 | 261 | @@ -887,6 +887,42 @@ | ||
638 | 262 | caps = conn.get_host_capabilities() | ||
639 | 263 | self.assertIn('aes', [x.name for x in caps.host.cpu.features]) | ||
640 | 264 | |||
641 | 265 | + def test_baseline_cpu_not_supported(self): | ||
642 | 266 | + conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) | ||
643 | 267 | + | ||
644 | 268 | + # `mock` has trouble stubbing attributes that don't exist yet, so | ||
645 | 269 | + # fallback to plain-Python attribute setting/deleting | ||
646 | 270 | + cap_str = 'VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES' | ||
647 | 271 | + if not hasattr(libvirt_driver.libvirt, cap_str): | ||
648 | 272 | + setattr(libvirt_driver.libvirt, cap_str, True) | ||
649 | 273 | + self.addCleanup(delattr, libvirt_driver.libvirt, cap_str) | ||
650 | 274 | + | ||
651 | 275 | + # Handle just the NO_SUPPORT error | ||
652 | 276 | + not_supported_exc = fakelibvirt.make_libvirtError( | ||
653 | 277 | + libvirt.libvirtError, | ||
654 | 278 | + 'this function is not supported by the connection driver:' | ||
655 | 279 | + ' virConnectBaselineCPU', | ||
656 | 280 | + error_code=libvirt.VIR_ERR_NO_SUPPORT) | ||
657 | 281 | + | ||
658 | 282 | + with mock.patch.object(conn._conn, 'baselineCPU', | ||
659 | 283 | + side_effect=not_supported_exc): | ||
660 | 284 | + caps = conn.get_host_capabilities() | ||
661 | 285 | + self.assertEqual(vconfig.LibvirtConfigCaps, type(caps)) | ||
662 | 286 | + self.assertNotIn('aes', [x.name for x in caps.host.cpu.features]) | ||
663 | 287 | + | ||
664 | 288 | + # Clear cached result so we can test again... | ||
665 | 289 | + conn._caps = None | ||
666 | 290 | + | ||
667 | 291 | + # Other errors should not be caught | ||
668 | 292 | + other_exc = fakelibvirt.make_libvirtError( | ||
669 | 293 | + libvirt.libvirtError, | ||
670 | 294 | + 'other exc', | ||
671 | 295 | + error_code=libvirt.VIR_ERR_NO_DOMAIN) | ||
672 | 296 | + | ||
673 | 297 | + with mock.patch.object(conn._conn, 'baselineCPU', | ||
674 | 298 | + side_effect=other_exc): | ||
675 | 299 | + self.assertRaises(libvirt.libvirtError, conn.get_host_capabilities) | ||
676 | 300 | + | ||
677 | 301 | def test_lxc_get_host_capabilities_failed(self): | ||
678 | 302 | conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) | ||
679 | 303 | |||
680 | 304 | 0 | ||
681 | === modified file 'debian/patches/series' | |||
682 | --- debian/patches/series 2014-11-10 16:31:07 +0000 | |||
683 | +++ debian/patches/series 2015-03-19 16:31:42 +0000 | |||
684 | @@ -1,8 +1,7 @@ | |||
685 | 1 | # Ubuntu specific patches below here. Note these can be dropped eventually. | 1 | # Ubuntu specific patches below here. Note these can be dropped eventually. |
687 | 2 | block-device-mapping-config.patch | 2 | drop-oslo-utils-usage.patch |
688 | 3 | disable-websockify-tests.patch | ||
689 | 3 | fix-requirements.patch | 4 | fix-requirements.patch |
690 | 4 | skip_ipv6_test.patch | 5 | skip_ipv6_test.patch |
691 | 5 | arm-console-patch.patch | 6 | arm-console-patch.patch |
692 | 6 | update-run-tests.patch | 7 | update-run-tests.patch |
693 | 7 | libvirt-Handle-unsupported-host-capabilities.patch | ||
694 | 8 | cells-json-store.patch | ||
695 | 9 | 8 | ||
696 | === modified file 'debian/patches/update-run-tests.patch' | |||
697 | --- debian/patches/update-run-tests.patch 2014-03-05 14:00:22 +0000 | |||
698 | +++ debian/patches/update-run-tests.patch 2015-03-19 16:31:42 +0000 | |||
699 | @@ -1,20 +1,9 @@ | |||
701 | 1 | Description: Update run_tests.sh to show results and default the concurrency to 1. | 1 | Description: Update run_tests.sh to show results. |
702 | 2 | Author: Chuck Short <zulcss@ubuntu.com> | 2 | Author: Chuck Short <zulcss@ubuntu.com> |
703 | 3 | Forwarded: Not needed. | 3 | Forwarded: Not needed. |
704 | 4 | diff --git a/run_tests.sh b/run_tests.sh | ||
705 | 5 | index 1fecc4c..84537cb 100755 | ||
706 | 6 | --- a/run_tests.sh | 4 | --- a/run_tests.sh |
707 | 7 | +++ b/run_tests.sh | 5 | +++ b/run_tests.sh |
718 | 8 | @@ -86,7 +86,7 @@ no_pep8=0 | 6 | @@ -137,14 +137,7 @@ |
709 | 9 | coverage=0 | ||
710 | 10 | debug=0 | ||
711 | 11 | update=0 | ||
712 | 12 | -concurrency=0 | ||
713 | 13 | +concurrency=4 | ||
714 | 14 | |||
715 | 15 | LANG=en_US.UTF-8 | ||
716 | 16 | LANGUAGE=en_US:en | ||
717 | 17 | @@ -137,14 +137,7 @@ function run_tests { | ||
719 | 18 | ${wrapper} python setup.py egg_info | 7 | ${wrapper} python setup.py egg_info |
720 | 19 | fi | 8 | fi |
721 | 20 | echo "Running \`${wrapper} $TESTRTESTS\`" | 9 | echo "Running \`${wrapper} $TESTRTESTS\`" |
722 | @@ -30,6 +19,3 @@ | |||
723 | 30 | RESULT=$? | 19 | RESULT=$? |
724 | 31 | set -e | 20 | set -e |
725 | 32 | 21 | ||
726 | 33 | -- | ||
727 | 34 | 1.9.0 | ||
728 | 35 |
Build failure:
https:/ /launchpad. net/~james- page/+archive/ ubuntu/ icehouse/ +build/ 7089237