Incorrect comparison of volume types with same encryption in cinder.volume.volume_types_encryption_changed()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Undecided
|
Vivek Soni |
Bug Description
def volume_
"""Return whether encryptions of two volume types are same."""
def _get_encryption
enc = dict(enc)
for param in ENCRYPTION_
return enc
enc1 = get_volume_
enc2 = get_volume_
enc1_filtered = _get_encryption
enc2_filtered = _get_encryption
return enc1_filtered != enc2_filtered
Values :-
-------
enc1_filtered = {'control_
enc2_filtered = {'control_
Issue :-
-------
Above code will always return true because 'encryption_id' field will always be unique(primary key in 'encryption' table in 'cinder' database)
Solution :-
-------
we need to ignore 'encryption_id' field before comparing dictionary.
Changed in cinder: | |
milestone: | none → pike-3 |
Fix proposed to branch: master /review. openstack. org/477888
Review: https:/