Merge "Fix 'KeyError' when 'with_count' is not specified"
This commit is contained in:
commit
5b5034a4e2
@ -103,7 +103,8 @@ class BackupsController(wsgi.Controller):
|
||||
sort_keys, sort_dirs = common.get_sort_params(filters)
|
||||
|
||||
show_count = False
|
||||
if req_version.matches(mv.SUPPORT_COUNT_INFO):
|
||||
if req_version.matches(
|
||||
mv.SUPPORT_COUNT_INFO) and 'with_count' in filters:
|
||||
show_count = utils.get_bool_param('with_count', filters)
|
||||
filters.pop('with_count')
|
||||
self._convert_sort_name(req_version, sort_keys)
|
||||
|
@ -80,7 +80,8 @@ class SnapshotsController(snapshots_v2.SnapshotsController):
|
||||
|
||||
req_version = req.api_version_request
|
||||
show_count = False
|
||||
if req_version.matches(mv.SUPPORT_COUNT_INFO):
|
||||
if req_version.matches(
|
||||
mv.SUPPORT_COUNT_INFO) and 'with_count' in search_opts:
|
||||
show_count = utils.get_bool_param('with_count', search_opts)
|
||||
search_opts.pop('with_count')
|
||||
|
||||
|
@ -99,7 +99,8 @@ class VolumeController(volumes_v2.VolumeController):
|
||||
filters = params
|
||||
|
||||
show_count = False
|
||||
if req_version.matches(mv.SUPPORT_COUNT_INFO):
|
||||
if req_version.matches(
|
||||
mv.SUPPORT_COUNT_INFO) and 'with_count' in filters:
|
||||
show_count = utils.get_bool_param('with_count', filters)
|
||||
filters.pop('with_count')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user