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] 94460b64fb/cinder/policies/volume_actions.py (L91)
[1] 94460b64fb/cinder/policies/volume_actions.py (L197)

Change-Id: I14b8288cdb066f30b66068dcaaf66e1277aa122f
This commit is contained in:
Felipe Monteiro 2018-01-03 04:18:02 +00:00
parent 94460b64fb
commit 678b9de0f4
2 changed files with 6 additions and 1 deletions

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')}

View File

@ -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".