summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEwan Mellor <emellor@silver>2010-09-30 17:28:17 +0000
committerTarmac <>2010-09-30 17:28:17 +0000
commitdee1e10bcab05f0f1ad487a7b43b16ea742727cf (patch)
treeb5e5b7543797efe1f1805125d4b8d0d993070e2a
parent4b432ddce0e54fab43c8352404d7be9af9677ea7 (diff)
parent76d9510ac496051697f7cdf0d693d5146e83283a (diff)
downloadnova-dee1e10bcab05f0f1ad487a7b43b16ea742727cf.tar.gz
nova-dee1e10bcab05f0f1ad487a7b43b16ea742727cf.tar.xz
nova-dee1e10bcab05f0f1ad487a7b43b16ea742727cf.zip
Bug #652103: NameError in exception handler in sqlalchemy API layer
Fix reference to NoResultFound.
-rw-r--r--nova/db/sqlalchemy/api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index 9c3caf9af..e63d3b18e 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -30,6 +30,7 @@ from nova.db.sqlalchemy.session import get_session
from sqlalchemy import or_
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import joinedload_all
+from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.sql import exists, func
FLAGS = flags.FLAGS
@@ -348,7 +349,7 @@ def fixed_ip_get_by_address(_context, address):
).filter_by(address=address
).filter_by(deleted=False
).one()
- except exc.NoResultFound:
+ except NoResultFound:
new_exc = exception.NotFound("No model for address %s" % address)
raise new_exc.__class__, new_exc, sys.exc_info()[2]