Browse Source

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
helei 4 months ago
parent
commit
18dcda1ee0

+ 0
- 10
karbor/api/v1/operation_logs.py View File

@@ -169,16 +169,6 @@ class OperationLogsController(wsgi.Controller):
169 169
 
170 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 172
         if filters:
183 173
             LOG.debug("Searching by: %s.", six.text_type(filters))
184 174
 

+ 0
- 10
karbor/api/v1/plans.py View File

@@ -212,16 +212,6 @@ class PlansController(wsgi.Controller):
212 212
 
213 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 215
         if filters:
226 216
             LOG.debug("Searching by: %s.", six.text_type(filters))
227 217
 

+ 0
- 10
karbor/api/v1/providers.py View File

@@ -228,16 +228,6 @@ class ProvidersController(wsgi.Controller):
228 228
         if filters is None:
229 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 231
         if filters:
242 232
             LOG.debug("Searching by: %s.", six.text_type(filters))
243 233
 

+ 0
- 10
karbor/api/v1/restores.py View File

@@ -168,16 +168,6 @@ class RestoresController(wsgi.Controller):
168 168
 
169 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 171
         if filters:
182 172
             LOG.debug("Searching by: %s.", six.text_type(filters))
183 173
 

+ 0
- 10
karbor/api/v1/verifications.py View File

@@ -166,16 +166,6 @@ class VerificationsController(wsgi.Controller):
166 166
 
167 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 169
         if filters:
180 170
             LOG.debug("Searching by: %s.", six.text_type(filters))
181 171
 

Loading…
Cancel
Save