Fix reserve volume enforcing the wrong policy action

This PS fixes `reserve_volume` enforcing the wrong
policy action: retype policy. It has been corrected
to reserve volume policy. This is consistent with
the policy in code documentation as well for both
policies: retype is only enforced by os-retype and
reserve is only enforced by os-reserve [0][1]

[0] https://github.com/openstack/cinder/blob/94460b64fb06814e18a4459e365cf207b730210b/cinder/policies/volume_actions.py#L91
[1] https://github.com/openstack/cinder/blob/94460b64fb06814e18a4459e365cf207b730210b/cinder/policies/volume_actions.py#L197

Change-Id: I14b8288cdb066f30b66068dcaaf66e1277aa122f
This commit is contained in:
Felipe Monteiro committed 2018-01-03 04:24:04 +00:00
1 parent 94460b64fb
commit 678b9de0f4
2 files changed
+6 -1

No files matched your search

+1 -1
View File
@@ -670,7 +670,7 @@ class API(base.Base):
return snapshots
def reserve_volume(self, context, volume):
context.authorize(vol_action_policy.RETYPE_POLICY, target_obj=volume)
context.authorize(vol_action_policy.RESERVE_POLICY, target_obj=volume)
expected = {'multiattach': volume.multiattach,
'status': (('available', 'in-use') if volume.multiattach
else 'available')}
@@ -0,0 +1,5 @@
---
fixes:
- |
The reserve volume API was incorrectly enforcing "volume:retype" policy
action. It has been corrected to "volume_extension:volume_actions:reserve".