summaryrefslogtreecommitdiffstats
path: root/nova/db
diff options
context:
space:
mode:
authorTrey Morris <trey.morris@rackspace.com>2011-06-20 11:56:15 -0500
committerTrey Morris <trey.morris@rackspace.com>2011-06-20 11:56:15 -0500
commit0502a2b35fb1a4424e7249cb9f39d7fc98bf37b5 (patch)
treedec6563c259d0a069077846177dc47b4a2b6f44e /nova/db
parent9873968029e19e9846e04951f841d02c27c9d6ae (diff)
updated the exceptions around virtual interface creation, updated flatDHCP manager comment
Diffstat (limited to 'nova/db')
-rw-r--r--nova/db/sqlalchemy/api.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index f86180b1f..3cb35b649 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -816,9 +816,12 @@ def virtual_interface_create(context, values):
:param values: = dict containing column values
"""
- vif_ref = models.VirtualInterface()
- vif_ref.update(values)
- vif_ref.save()
+ try:
+ vif_ref = models.VirtualInterface()
+ vif_ref.update(values)
+ vif_ref.save()
+ except IntegrityError:
+ raise exception.VirtualInterfaceCreateException()
return vif_ref