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