Unused schema in nailgun objects adding to technical debt of code

Bug #1483539 reported by Przemyslaw Kaminski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Confirmed
Medium
Fuel Sustaining
Mitaka
Won't Fix
Medium
Fuel Python (Deprecated)
Newton
Confirmed
Medium
Fuel Sustaining

Bug Description

We have a 'schema' dict in NailgunObject https://github.com/stackforge/fuel-web/blob/stable/6.1/nailgun/nailgun/objects/base.py#L56-L58 which is used only in the NailgunObject.check_field method (https://github.com/stackforge/fuel-web/blob/stable/6.1/nailgun/nailgun/objects/base.py#L60-L74) which in turn is used only in NailgunCollection.filter_by (https://github.com/stackforge/fuel-web/blob/stable/6.1/nailgun/nailgun/objects/base.py#L261-L287) and NailgunCollection.filter_by_not (https://github.com/stackforge/fuel-web/blob/stable/6.1/nailgun/nailgun/objects/base.py#L289-L314). The only class with schema implemented is NodeGroups (https://github.com/stackforge/fuel-web/blob/stable/6.1/nailgun/nailgun/objects/node_group.py#L28-L43). I suggest to remove all of this code -- writer of filter_by queries should know what fields to filter by, it doesn't have to be automatically checked, especially that SQLAlchemy does such checks already. Removing all of it will reduce technical debt of the code (and schema from NodeGroups.schema can be moved to api/v1/validators/json_schema).

tags: added: module-nailgun
Changed in fuel:
milestone: none → 8.0
status: New → Confirmed
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :

We passed SCF in 8.0. Moving the bug to 9.0.

Changed in fuel:
milestone: 8.0 → 9.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.