Added ability to remove networks on nova-manage command

This commit is contained in:
Ricardo Carrillo Cruz
2011-03-08 18:53:20 +01:00
parent 18f3ab4745
commit 4fc941dcbf

View File

@@ -548,7 +548,11 @@ class NetworkCommands(object):
def delete(self, fixed_range): def delete(self, fixed_range):
"""Deletes a network""" """Deletes a network"""
network = db.network_get_by_cidr(context.get_admin_context(), fixed_range) network = db.network_get_by_cidr(context.get_admin_context(), fixed_range)
if network.project_id is not None:
raise ValueError(_('Network must be disassociated from project %s'
' before delete' %network.project_id))
db.network_delete_safe(context.get_admin_context(), network.id)
class ServiceCommands(object): class ServiceCommands(object):
"""Enable and disable running services""" """Enable and disable running services"""