@wrap_check_policy
def check_attach(self, context, volume):
    if (volume['status'] != 'available'):
        msg = _('status must be available')
        raise exception.InvalidVolume(reason=msg)
    if (volume['attach_status'] == 'attached'):
        msg = _('already attached')
        raise exception.InvalidVolume(reason=msg)
@wrap_check_policy
def check_attach(self, context, volume):
    if (volume['status'] != 'available'):
        msg = _('status must be available')
        raise exception.InvalidVolume(reason=msg)
    if (volume['attach_status'] == 'attached'):
        msg = _('already attached')
        raise exception.InvalidVolume(reason=msg)