Tautology in libvirt driver cleanup method

Bug #1544103 reported by Timofey Durakov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Unassigned

Bug Description

for clean up phase in driver destroy_disks parameter is calculated in compute manager https://github.com/openstack/nova/blob/8615de1bb7afac8ffbd7d9c8f8e7235c49df9b39/nova/compute/manager.py#L5303 like:
 destroy_disks = not is_shared_block_storage
Then in libvirt driver cleanup method there is expression
https://github.com/openstack/nova/blob/8615de1bb7afac8ffbd7d9c8f8e7235c49df9b39/nova/virt/libvirt/driver.py#L1117

if destroy_disks or is_shared_block_storage:

which doesn't make sense as its tautology and always evaluated to True.

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Changed in nova:
assignee: nobody → Sana Khan (sana.khan)
Changed in nova:
assignee: Sana Khan (sana.khan) → Timofey Durakov (tdurakov)
status: Confirmed → In Progress
Revision history for this message
Sana Khan (sanakhanlibre) wrote :

The expression 'if destroy_disks or is_shared_block_storage:'

will be a Tautology only when both the ifs are evaluated as true:

https://github.com/openstack/nova/blob/8615de1bb7afac8ffbd7d9c8f8e7235c49df9b39/nova/compute/manager.py#L5295-L5297
https://github.com/openstack/nova/blob/8615de1bb7afac8ffbd7d9c8f8e7235c49df9b39/nova/virt/libvirt/driver.py#L1115-L1116

For other cases, it won't be a Tautology.

Changed in nova:
status: In Progress → Confirmed
Revision history for this message
Timofey Durakov (tdurakov) wrote :

@sana.khan, yes, and it's exactly libvirt driver case.

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/302611

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/302611
Reason: This patch has been sitting unchanged for more than 12 weeks. I am therefore going to abandon it to keep the nova review queue sane. Please feel free to restore the change if you're still working on it.

Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing
the status back to the previous state and unassigning. If
there are active reviews related to this bug, please include
links in comments.

Changed in nova:
status: In Progress → Confirmed
assignee: Timofey Durakov (tdurakov) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.