'Regression test for bug #1554631.
When the Cinder client returns a 403 Forbidden on any operation,
the Nova API should forward on the 403 instead of returning 500.'

@mock.patch('nova.volume.cinder.cinderclient')
def test_forbidden_cinder_operation_returns_403(self, mock_cinder):

    cinder_client = mock.Mock()
    mock_cinder.return_value = cinder_client
    exc = cinder_exceptions.Forbidden(403)
    cinder_client.volumes.create.side_effect = exc
    volume = {'display_name': 'vol1', 'size': 3}
    e = self.assertRaises(client.OpenStackApiException, self.api.post_volume, {'volume': volume})
    self.assertEqual(403, e.response.status_code)
