Unnecessarily use of a list and extra loop call to offload the shelved instances whose shelved time passed the shelved offload time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Low
|
Unassigned |
Bug Description
Unnecessarily use of a list and extra loop call to offload the shelved instances whose shelved time passed the shelved offload time.
To offload the shelved instances whose shelved time passed the shelved offload time, first list is created and then this list of shelved instances is processed in extra loop. Instead of creating a list of offload ready shelved instances and processing them later, same can be done in one loop.
Code should be refactored. Instead of creating a list of offload ready shelved instances and processing them later, same can be done in one loop. Instances can be offloaded the time when their shelved time is checked. (Reference File: nova/compute/
So this:
https:/ /github. com/openstack/ nova/blob/ 0e48e7b1d2ee914 152958d10f9725a a86daafbb6/ nova/compute/ manager. py#L6809- L6812