diff options
author | helei <helei@cmss.chinamobile.com> | 2018-11-28 10:53:16 +0800 |
---|---|---|
committer | Jiao Pengju <jiaopengju@cmss.chinamobile.com> | 2018-11-28 10:55:44 +0000 |
commit | 18dcda1ee0ac211d84a1d78499e62be92f91fa9b (patch) | |
tree | 3bd30a8be67622b28a49c25bcc27e74ddf83c490 | |
parent | 7824d9a43277b94cf17a3947c666a9ae5e88cf14 (diff) |
Remove redundant limit param check in API
limit param has been checked in get_pagination_params
method before calling _get_all method
Change-Id: I987f88981bcca7219142aeed4a8c730832f00348
Notes
Notes (review):
Code-Review+2: Jiao Pengju <jiaopengju@cmss.chinamobile.com>
Workflow+1: Jiao Pengju <jiaopengju@cmss.chinamobile.com>
Verified+2: Zuul
Submitted-by: Zuul
Submitted-at: Wed, 28 Nov 2018 14:48:49 +0000
Reviewed-on: https://review.openstack.org/620439
Project: openstack/karbor
Branch: refs/heads/master
-rw-r--r-- | karbor/api/v1/operation_logs.py | 10 | ||||
-rw-r--r-- | karbor/api/v1/plans.py | 10 | ||||
-rw-r--r-- | karbor/api/v1/providers.py | 10 | ||||
-rw-r--r-- | karbor/api/v1/restores.py | 10 | ||||
-rw-r--r-- | karbor/api/v1/verifications.py | 10 |
5 files changed, 0 insertions, 50 deletions
diff --git a/karbor/api/v1/operation_logs.py b/karbor/api/v1/operation_logs.py index adf5e7c..670fb5b 100644 --- a/karbor/api/v1/operation_logs.py +++ b/karbor/api/v1/operation_logs.py | |||
@@ -169,16 +169,6 @@ class OperationLogsController(wsgi.Controller): | |||
169 | 169 | ||
170 | all_tenants = utils.get_bool_param('all_tenants', filters) | 170 | all_tenants = utils.get_bool_param('all_tenants', filters) |
171 | 171 | ||
172 | try: | ||
173 | if limit is not None: | ||
174 | limit = int(limit) | ||
175 | if limit < 0: | ||
176 | msg = _('limit param must be positive') | ||
177 | raise exception.InvalidInput(reason=msg) | ||
178 | except ValueError: | ||
179 | msg = _('limit param must be an integer') | ||
180 | raise exception.InvalidInput(reason=msg) | ||
181 | |||
182 | if filters: | 172 | if filters: |
183 | LOG.debug("Searching by: %s.", six.text_type(filters)) | 173 | LOG.debug("Searching by: %s.", six.text_type(filters)) |
184 | 174 | ||
diff --git a/karbor/api/v1/plans.py b/karbor/api/v1/plans.py index f145d1d..8f0d61c 100644 --- a/karbor/api/v1/plans.py +++ b/karbor/api/v1/plans.py | |||
@@ -212,16 +212,6 @@ class PlansController(wsgi.Controller): | |||
212 | 212 | ||
213 | all_tenants = utils.get_bool_param('all_tenants', filters) | 213 | all_tenants = utils.get_bool_param('all_tenants', filters) |
214 | 214 | ||
215 | try: | ||
216 | if limit is not None: | ||
217 | limit = int(limit) | ||
218 | if limit < 0: | ||
219 | msg = _('limit param must be positive') | ||
220 | raise exception.InvalidInput(reason=msg) | ||
221 | except ValueError: | ||
222 | msg = _('limit param must be an integer') | ||
223 | raise exception.InvalidInput(reason=msg) | ||
224 | |||
225 | if filters: | 215 | if filters: |
226 | LOG.debug("Searching by: %s.", six.text_type(filters)) | 216 | LOG.debug("Searching by: %s.", six.text_type(filters)) |
227 | 217 | ||
diff --git a/karbor/api/v1/providers.py b/karbor/api/v1/providers.py index 095ffa5..96854d1 100644 --- a/karbor/api/v1/providers.py +++ b/karbor/api/v1/providers.py | |||
@@ -228,16 +228,6 @@ class ProvidersController(wsgi.Controller): | |||
228 | if filters is None: | 228 | if filters is None: |
229 | filters = {} | 229 | filters = {} |
230 | 230 | ||
231 | try: | ||
232 | if limit is not None: | ||
233 | limit = int(limit) | ||
234 | if limit <= 0: | ||
235 | msg = _('limit param must be positive') | ||
236 | raise exception.InvalidInput(reason=msg) | ||
237 | except ValueError: | ||
238 | msg = _('limit param must be an integer') | ||
239 | raise exception.InvalidInput(reason=msg) | ||
240 | |||
241 | if filters: | 231 | if filters: |
242 | LOG.debug("Searching by: %s.", six.text_type(filters)) | 232 | LOG.debug("Searching by: %s.", six.text_type(filters)) |
243 | 233 | ||
diff --git a/karbor/api/v1/restores.py b/karbor/api/v1/restores.py index 3dea082..08f91ce 100644 --- a/karbor/api/v1/restores.py +++ b/karbor/api/v1/restores.py | |||
@@ -168,16 +168,6 @@ class RestoresController(wsgi.Controller): | |||
168 | 168 | ||
169 | all_tenants = utils.get_bool_param('all_tenants', filters) | 169 | all_tenants = utils.get_bool_param('all_tenants', filters) |
170 | 170 | ||
171 | try: | ||
172 | if limit is not None: | ||
173 | limit = int(limit) | ||
174 | if limit <= 0: | ||
175 | msg = _('limit param must be positive') | ||
176 | raise exception.InvalidInput(reason=msg) | ||
177 | except ValueError: | ||
178 | msg = _('limit param must be an integer') | ||
179 | raise exception.InvalidInput(reason=msg) | ||
180 | |||
181 | if filters: | 171 | if filters: |
182 | LOG.debug("Searching by: %s.", six.text_type(filters)) | 172 | LOG.debug("Searching by: %s.", six.text_type(filters)) |
183 | 173 | ||
diff --git a/karbor/api/v1/verifications.py b/karbor/api/v1/verifications.py index b128911..bfe0677 100644 --- a/karbor/api/v1/verifications.py +++ b/karbor/api/v1/verifications.py | |||
@@ -166,16 +166,6 @@ class VerificationsController(wsgi.Controller): | |||
166 | 166 | ||
167 | all_tenants = utils.get_bool_param('all_tenants', filters) | 167 | all_tenants = utils.get_bool_param('all_tenants', filters) |
168 | 168 | ||
169 | try: | ||
170 | if limit is not None: | ||
171 | limit = int(limit) | ||
172 | if limit <= 0: | ||
173 | msg = _('limit param must be positive') | ||
174 | raise exception.InvalidInput(reason=msg) | ||
175 | except ValueError: | ||
176 | msg = _('limit param must be an integer') | ||
177 | raise exception.InvalidInput(reason=msg) | ||
178 | |||
179 | if filters: | 169 | if filters: |
180 | LOG.debug("Searching by: %s.", six.text_type(filters)) | 170 | LOG.debug("Searching by: %s.", six.text_type(filters)) |
181 | 171 | ||