Only enforce multiattach policy for retype target
We should only be checking multiattach policy if the target
of a retype is multiattach capable. If they are already on
a type and policy has changed, we should not block retyping.
@@ -1653,6 +1653,10 @@ class API(base.Base):
'of: %s.') % volume.status
LOG.info(msg)
raise exception.InvalidInput(reason=msg)
+
+ # If they are retyping to a multiattach capable, make sure they
+ # are allowed to do so.
+ if tgt_is_multiattach:
context.authorize(vol_policy.MULTIATTACH_POLICY)
# We're checking here in so that we can report any quota issues as
