Merge "Fix the terminated_at field in the server query params schema"
This commit is contained in:
commit
d92e56a99d
@ -324,7 +324,7 @@ query_params_v21 = {
|
|||||||
'flavor': common_regex_param,
|
'flavor': common_regex_param,
|
||||||
'reservation_id': common_regex_param,
|
'reservation_id': common_regex_param,
|
||||||
'launched_at': common_regex_param,
|
'launched_at': common_regex_param,
|
||||||
'terminate_at': common_regex_param,
|
'terminated_at': common_regex_param,
|
||||||
'availability_zone': common_regex_param,
|
'availability_zone': common_regex_param,
|
||||||
# NOTE(alex_xu): This is pattern matching, it didn't get any benefit
|
# NOTE(alex_xu): This is pattern matching, it didn't get any benefit
|
||||||
# from DB index.
|
# from DB index.
|
||||||
|
@ -1182,6 +1182,7 @@ class ServersControllerTest(ControllerTest):
|
|||||||
self.assertIsNotNone(search_opts)
|
self.assertIsNotNone(search_opts)
|
||||||
# Allowed by user
|
# Allowed by user
|
||||||
self.assertIn('name', search_opts)
|
self.assertIn('name', search_opts)
|
||||||
|
self.assertIn('terminated_at', search_opts)
|
||||||
# OSAPI converts status to vm_state
|
# OSAPI converts status to vm_state
|
||||||
self.assertIn('vm_state', search_opts)
|
self.assertIn('vm_state', search_opts)
|
||||||
# Allowed only by admins with admin API on
|
# Allowed only by admins with admin API on
|
||||||
@ -1192,7 +1193,8 @@ class ServersControllerTest(ControllerTest):
|
|||||||
|
|
||||||
self.stubs.Set(compute_api.API, 'get_all', fake_get_all)
|
self.stubs.Set(compute_api.API, 'get_all', fake_get_all)
|
||||||
|
|
||||||
query_str = "name=foo&ip=10.*&status=active&unknown_option=meow"
|
query_str = ("name=foo&ip=10.*&status=active&unknown_option=meow&"
|
||||||
|
"terminated_at=^2016-02-01.*")
|
||||||
req = self.req('/fake/servers?%s' % query_str,
|
req = self.req('/fake/servers?%s' % query_str,
|
||||||
use_admin_context=True)
|
use_admin_context=True)
|
||||||
servers = self.controller.index(req)['servers']
|
servers = self.controller.index(req)['servers']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user