Clean up network create exception handling

The NetworkManager code will not raise webob exceptions, so there's no
point in explicitly catching those.

Also, the contrib.networks module is unused in nova-manage.

Change-Id: I5f9fe7fa7f4365f44e7a70b3d9536da8f10b8fa7
This commit is contained in:
Mark McLoughlin 2012-08-24 16:09:27 +01:00
parent d96416a990
commit c8520524b5
1 changed files with 1 additions and 7 deletions

View File

@ -83,7 +83,6 @@ from nova import db
from nova.db import migration
from nova import exception
from nova import flags
from nova.api.openstack.compute.contrib import networks
from nova.openstack.common import cfg
from nova.openstack.common import importutils
from nova.openstack.common import log as logging
@ -95,8 +94,6 @@ from nova import utils
from nova import version
from nova.volume import volume_types
from webob import exc
FLAGS = flags.FLAGS
flags.DECLARE('flat_network_bridge', 'nova.network.manager')
flags.DECLARE('num_networks', 'nova.network.manager')
@ -479,10 +476,7 @@ class NetworkCommands(object):
if multi_host is not None:
kwargs['multi_host'] = multi_host == 'T'
net_manager = importutils.import_object(FLAGS.network_manager)
try:
net_manager.create_networks(context.get_admin_context(), **kwargs)
except exc.HTTPBadRequest as ex:
print ex
net_manager.create_networks(context.get_admin_context(), **kwargs)
def list(self):
"""List all created networks"""