diff options
author | Takashi Natsume <natsume.takashi@lab.ntt.co.jp> | 2019-02-12 11:46:57 +0900 |
---|---|---|
committer | Takashi NATSUME <natsume.takashi@lab.ntt.co.jp> | 2019-02-26 09:26:52 +0900 |
commit | 67d5970445818f2f245cf1b6d9d46c36fb220f04 (patch) | |
tree | a569c8aee604bea225ac5f6cbeda828ca586523f /nova/tests/unit/fake_request_spec.py | |
parent | 29e5b0ad7bde210f95885656768f0480d06882c0 (diff) | |
download | nova-67d5970445818f2f245cf1b6d9d46c36fb220f04.tar.gz |
Fix resetting non-persistent fields when saving obj
The 'requested_destination', 'network_metadata', 'retry' fields
in the RequestSpec object are reset when saving the object currently.
When cold migrating a server, the API sets the requested_destination
so conductor will pass that information to the scheduler
to restrict the cold migration to that host.
But the 'heal_reqspec_is_bfv' method called from the conductor
makes an update to the RequestSpec which resets
the requested_destination so the server could end up being cold migrated
to some other host than the one that was requested by the API user.
So make them not be reset when saving the object.
Change-Id: I2131558f0edfe603ee1e8d8bae66a3caf5182a58
Closes-Bug: #1815153
Diffstat (limited to 'nova/tests/unit/fake_request_spec.py')
-rw-r--r-- | nova/tests/unit/fake_request_spec.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/tests/unit/fake_request_spec.py b/nova/tests/unit/fake_request_spec.py index 6d7e50fcb1..e7958eab90 100644 --- a/nova/tests/unit/fake_request_spec.py +++ b/nova/tests/unit/fake_request_spec.py @@ -57,6 +57,8 @@ PCI_REQUESTS.obj_reset_changes(recursive=True) def fake_db_spec(): req_obj = fake_spec_obj() + # NOTE(takashin): There is not 'retry' information in the DB table. + del req_obj.retry db_request_spec = { 'id': 1, 'instance_uuid': req_obj.instance_uuid, |