From 383bcbca707dd85729739640e62143c16cbb0b9a Mon Sep 17 00:00:00 2001 From: dengzhaosen Date: Thu, 8 Oct 2020 16:48:15 +0800 Subject: [PATCH] optimize the shelve code flow Change-Id: I23d59ba4a33a183f99f651cc04fadefb3ea68722 --- nova/compute/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 20f5f76020ab..7f304c31222e 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -6407,7 +6407,7 @@ class ComputeManager(manager.Manager): instance.system_metadata['shelved_host'] = self.host instance.vm_state = vm_states.SHELVED instance.task_state = None - if CONF.shelved_offload_time == 0: + if offload: instance.task_state = task_states.SHELVING_OFFLOADING instance.power_state = self._get_power_state(instance) instance.save(expected_task_state=[