SQLAlchemy Query.all() can't raise NoResultFound exception
Bug #1173131 reported by
Roman Podoliaka
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Low
|
Roman Podoliaka |
Bug Description
all() returns an empty list when no result is found, so there is no sense to except NoResultFound and return an empty list like the following code does:
try:
dns_qry = context.
return dns_qry.
except exc.NoResultFound:
return []
We have a lot of such cases in our code which should be fixed.
tags: | added: db |
Changed in quantum: | |
assignee: | nobody → Roman Podolyaka (rpodolyaka) |
Changed in quantum: | |
status: | New → Confirmed |
Changed in quantum: | |
milestone: | none → havana-1 |
importance: | Undecided → Low |
Changed in quantum: | |
status: | Fix Committed → Fix Released |
Changed in neutron: | |
milestone: | havana-1 → 2013.2 |
To post a comment you must log in.
Fix proposed to branch: master /review. openstack. org/27687
Review: https:/