Code duplication. db_base_plugin_v2.py and loadbalancer_db.py duplicate code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Wishlist
|
Eugene Nikanorov |
Bug Description
quantum/
Here is the duplicated code:
def _fields(self, resource, fields):
if fields:
return dict((key, item) for key, item in resource.
return resource
def _apply_
if filters:
for key, value in filters.
if column:
return query
def _get_collection
collection = self._model_
collection = self._apply_
return collection
def _get_collection
query = self._get_
return [dict_func(c, fields) for c in query.all()]
def _get_collection
return self._get_
Needs to have common parent to support this code.
Changed in quantum: | |
assignee: | nobody → Avishay Balderman (avishayb) |
tags: | added: api db |
Changed in quantum: | |
assignee: | Avishay Balderman (avishayb) → Eugene Nikanorov (enikanorov) |
Changed in quantum: | |
milestone: | none → havana-2 |
Changed in neutron: | |
status: | Fix Committed → Fix Released |
Changed in neutron: | |
milestone: | havana-2 → 2013.2 |
Question: Will a 'mixin' class work for us here?