'Check raising exception due to resize call failing.
If the status after a resize is not VERIFY_RESIZE, it means the resize
call failed, so we raise an explicit error.'

def test_server_update_server_flavor_failed(self):

    return_server = self.fc.servers.list()[1]
    return_server.id = '1234'
    server = self._create_test_server(return_server, 'srv_update2')
    update_props = self.server_props.copy()
    update_props['flavor'] = 'm1.small'
    update_template = server.t.freeze(properties=update_props)
    def set_status(status):
        return_server.status = status
        return return_server
    self.patchobject(self.fc.servers, 'get', side_effect=[set_status('RESIZE'), set_status('ERROR')])
    mock_post = self.patchobject(self.fc.client, 'post_servers_1234_action', return_value=(202, None))
    updater = scheduler.TaskRunner(server.update, update_template)
    error = self.assertRaises(exception.ResourceFailure, updater)
    self.assertEqual("Error:    resources.srv_update2:    Resizing    to    '2'    failed,    status    'ERROR'", six.text_type(error))
    self.assertEqual((server.UPDATE, server.FAILED), server.state)
    mock_post.called_once_with(body={'resize': {'flavorRef': 2}})
