fix broken flush in db.network_destroy, pep8 fixes

This commit is contained in:
Dan Wendlandt 2011-08-02 10:14:25 -07:00
parent 67af7c736c
commit 32b5806ddf
3 changed files with 5 additions and 1 deletions

View File

@ -91,6 +91,7 @@ class NetworkInUse(webob.exc.HTTPClientError):
title = 'Network in Use'
explanation = ('Unable to remove the network: attachments still plugged.')
class NetworkNameExists(webob.exc.HTTPClientError):
"""
subclass of :class:`~HTTPClientError`

View File

@ -107,6 +107,7 @@ class AlreadyAttached(QuantumException):
"%(port_id)s for network %(net_id)s. The attachment is " \
"already plugged into port %(att_port_id)s")
class NetworkNameExists(QuantumException):
message = _("Unable to set network name to %(net_name). " \
"Network with id %(net_id) already has this name for " \

View File

@ -89,6 +89,7 @@ def _check_duplicate_net_name(tenant_id, net_name):
# that net-names are unique within a tenant
pass
def network_create(tenant_id, name):
session = get_session()
@ -126,6 +127,7 @@ def network_rename(net_id, tenant_id, new_name):
session.flush()
return net
def network_destroy(net_id):
session = get_session()
try:
@ -225,7 +227,7 @@ def port_unset_attachment(port_id, net_id):
port = port_get(port_id, net_id)
port.interface_id = None
session.merge(port)
session.flush
session.flush()
def port_destroy(port_id, net_id):