Merge "Remove logging of exceptions from controller's methods"

This commit is contained in:
Jenkins 2014-03-25 22:25:15 +00:00 committed by Gerrit Code Review
commit acd440ec54
4 changed files with 8 additions and 38 deletions

View File

@ -32,10 +32,6 @@ from ironic.api.controllers.v1 import types
from ironic.api.controllers.v1 import utils as api_utils
from ironic.common import exception
from ironic import objects
from ironic.openstack.common import excutils
from ironic.openstack.common import log
LOG = log.getLogger(__name__)
class ChassisPatchType(types.JsonPatchType):
@ -210,11 +206,8 @@ class ChassisController(rest.RestController):
:param chassis: a chassis within the request body.
"""
try:
new_chassis = pecan.request.dbapi.create_chassis(chassis.as_dict())
except Exception as e:
with excutils.save_and_reraise_exception():
LOG.exception(e)
new_chassis = pecan.request.dbapi.create_chassis(chassis.as_dict())
return Chassis.convert_with_links(new_chassis)
@wsme.validate(types.uuid, [ChassisPatchType])

View File

@ -23,9 +23,6 @@ import wsmeext.pecan as wsme_pecan
from ironic.api.controllers import base
from ironic.api.controllers import link
from ironic.common import exception
from ironic.openstack.common import log
LOG = log.getLogger(__name__)
class Driver(base.APIBase):

View File

@ -34,16 +34,12 @@ from ironic.common import exception
from ironic.common import states as ir_states
from ironic.common import utils
from ironic import objects
from ironic.openstack.common import excutils
from ironic.openstack.common import log
CONF = cfg.CONF
CONF.import_opt('heartbeat_timeout', 'ironic.conductor.manager',
group='conductor')
LOG = log.getLogger(__name__)
class NodePatchType(types.JsonPatchType):
@ -205,7 +201,6 @@ class NodeStatesController(rest.RestController):
if target == rpc_node.provision_state:
msg = (_("Node %(node)s is already in the '%(state)s' state.") %
{'node': rpc_node['uuid'], 'state': target})
LOG.exception(msg)
raise wsme.exc.ClientSideError(msg, status_code=400)
if target == ir_states.ACTIVE:
@ -219,7 +214,6 @@ class NodeStatesController(rest.RestController):
if processing:
msg = (_('Node %s is already being provisioned or decommissioned.')
% rpc_node.uuid)
LOG.exception(msg)
raise wsme.exc.ClientSideError(msg, status_code=409) # Conflict
# Note that there is a race condition. The node state(s) could change
@ -624,11 +618,8 @@ class NodesController(rest.RestController):
e.code = 400
raise e
try:
new_node = pecan.request.dbapi.create_node(node.as_dict())
except Exception as e:
with excutils.save_and_reraise_exception():
LOG.exception(e)
new_node = pecan.request.dbapi.create_node(node.as_dict())
return Node.convert_with_links(new_node)
@wsme.validate(types.uuid, [NodePatchType])
@ -675,12 +666,8 @@ class NodesController(rest.RestController):
e.code = 400
raise e
try:
new_node = pecan.request.rpcapi.update_node(
pecan.request.context, rpc_node, topic)
except Exception as e:
with excutils.save_and_reraise_exception():
LOG.exception(e)
new_node = pecan.request.rpcapi.update_node(
pecan.request.context, rpc_node, topic)
return Node.convert_with_links(new_node)

View File

@ -30,10 +30,6 @@ from ironic.api.controllers.v1 import types
from ironic.api.controllers.v1 import utils as api_utils
from ironic.common import exception
from ironic import objects
from ironic.openstack.common import excutils
from ironic.openstack.common import log
LOG = log.getLogger(__name__)
class PortPatchType(types.JsonPatchType):
@ -252,11 +248,8 @@ class PortsController(rest.RestController):
if self._from_nodes:
raise exception.OperationNotPermitted
try:
new_port = pecan.request.dbapi.create_port(port.as_dict())
except Exception as e:
with excutils.save_and_reraise_exception():
LOG.exception(e)
new_port = pecan.request.dbapi.create_port(port.as_dict())
return Port.convert_with_links(new_port)
@wsme.validate(types.uuid, [PortPatchType])