|
11 | 11 | # under the License.
|
12 | 12 |
|
13 | 13 | import mock
|
14 |
| -import six |
15 | 14 |
|
16 | 15 | from nova.conductor import api as conductor_api
|
17 | 16 | from nova import context as nova_context
|
18 |
| -from nova import exception |
19 | 17 | from nova import objects
|
20 | 18 | from nova.scheduler import weights
|
21 | 19 | from nova import test
|
@@ -142,17 +140,10 @@ def stub_resize_instance(_self, context, instance,
|
142 | 140 | with mock.patch.dict(host1_driver.capabilities,
|
143 | 141 | supports_migrate_to_same_host=False):
|
144 | 142 | self.api.post_server_action(server['id'], {'migrate': None})
|
145 |
| - # FIXME(mriedem): Due to bug 1830747 we don't go to VERIFY_RESIZE |
146 |
| - # because the reschedule fails and the instance is put into |
147 |
| - # ERROR status. When the bug is fixed the status should be |
148 |
| - # VERIFY_RESIZE and the server should be on host2. |
149 | 143 | server = self._wait_for_state_change(
|
150 |
| - self.api, server, 'ERROR') |
151 |
| - self.assertEqual('host1', server['OS-EXT-SRV-ATTR:host']) |
152 |
| - |
153 |
| - # And the RequestSpec.instance_group.uuid should be missing which |
154 |
| - # leads to us failing to load the RequestSpec. |
155 |
| - ex = self.assertRaises(exception.ObjectActionError, |
156 |
| - objects.RequestSpec.get_by_instance_uuid, |
157 |
| - ctxt, server['id']) |
158 |
| - self.assertIn('unable to load uuid', six.text_type(ex)) |
| 144 | + self.api, server, 'VERIFY_RESIZE') |
| 145 | + self.assertEqual('host2', server['OS-EXT-SRV-ATTR:host']) |
| 146 | + |
| 147 | + # The RequestSpec.instance_group.uuid should still be set. |
| 148 | + reqspec = objects.RequestSpec.get_by_instance_uuid(ctxt, server['id']) |
| 149 | + self.assertEqual(group_id, reqspec.instance_group.uuid) |
0 commit comments