Merge "Raising 400 Bad Request when using "changes-since" filter on v2"
This commit is contained in:
commit
a28db383fc
|
@ -518,6 +518,10 @@ class RequestDeserializer(wsgi.JSONRequestDeserializer):
|
|||
if visibility not in ['public', 'private', 'shared']:
|
||||
msg = _('Invalid visibility value: %s') % visibility
|
||||
raise webob.exc.HTTPBadRequest(explanation=msg)
|
||||
changes_since = filters.get('changes-since', None)
|
||||
if changes_since:
|
||||
msg = _('The "changes-since" filter is no longer available on v2.')
|
||||
raise webob.exc.HTTPBadRequest(explanation=msg)
|
||||
|
||||
return filters
|
||||
|
||||
|
|
|
@ -202,6 +202,15 @@ class TestImages(functional.FunctionalTest):
|
|||
self.assertEqual(1, len(images))
|
||||
self.assertEqual(images[0]['id'], image_id)
|
||||
|
||||
# The "changes-since" filter shouldn't work on glance v2
|
||||
path = self._url('/v2/images?changes-since=20001007T10:10:10')
|
||||
response = requests.get(path, headers=self._headers())
|
||||
self.assertEqual(400, response.status_code)
|
||||
|
||||
path = self._url('/v2/images?changes-since=aaa')
|
||||
response = requests.get(path, headers=self._headers())
|
||||
self.assertEqual(400, response.status_code)
|
||||
|
||||
# Image list should list only image-1 based on the filter
|
||||
# 'foo=bar&abc=xyz'
|
||||
path = self._url('/v2/images?foo=bar&abc=xyz')
|
||||
|
|
Loading…
Reference in New Issue