From 6ebe7fd5f0c3fbe9b409f643237be837c5266dea Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Wed, 19 Sep 2012 22:27:20 +0000 Subject: No stack trace on bad nova aggregate-* command When a 'nova aggregate-*; command is run with a bad parameter, Nova-api should not throw a stack trace. For example: 'nova aggregate-details badID' shouldn't cause a stack trace fix bug 1053150 Change-Id: Iab6059f44b7cfb5428a2b55cea53d63809d7a575 --- nova/api/openstack/compute/contrib/aggregates.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/aggregates.py b/nova/api/openstack/compute/contrib/aggregates.py index 54eca8288..9435f5980 100644 --- a/nova/api/openstack/compute/contrib/aggregates.py +++ b/nova/api/openstack/compute/contrib/aggregates.py @@ -73,7 +73,7 @@ class AggregateController(object): aggregate = self.api.create_aggregate(context, name, avail_zone) except (exception.AggregateNameExists, exception.InvalidAggregateAction): - LOG.exception(_("Cannot create aggregate with name %(name)s and " + LOG.info(_("Cannot create aggregate with name %(name)s and " "availability zone %(avail_zone)s") % locals()) raise exc.HTTPConflict return self._marshall_aggregate(aggregate) @@ -85,7 +85,7 @@ class AggregateController(object): try: aggregate = self.api.get_aggregate(context, id) except exception.AggregateNotFound: - LOG.exception(_("Cannot show aggregate: %(id)s") % locals()) + LOG.info(_("Cannot show aggregate: %(id)s") % locals()) raise exc.HTTPNotFound return self._marshall_aggregate(aggregate) @@ -111,7 +111,7 @@ class AggregateController(object): try: aggregate = self.api.update_aggregate(context, id, updates) except exception.AggregateNotFound: - LOG.exception(_("Cannot update aggregate: %(id)s") % locals()) + LOG.info(_("Cannot update aggregate: %(id)s") % locals()) raise exc.HTTPNotFound return self._marshall_aggregate(aggregate) @@ -123,7 +123,7 @@ class AggregateController(object): try: self.api.delete_aggregate(context, id) except exception.AggregateNotFound: - LOG.exception(_("Cannot delete aggregate: %(id)s") % locals()) + LOG.info(_("Cannot delete aggregate: %(id)s") % locals()) raise exc.HTTPNotFound def action(self, req, id, body): @@ -149,12 +149,12 @@ class AggregateController(object): try: aggregate = self.api.add_host_to_aggregate(context, id, host) except (exception.AggregateNotFound, exception.ComputeHostNotFound): - LOG.exception(_("Cannot add host %(host)s in aggregate " + LOG.info(_("Cannot add host %(host)s in aggregate " "%(id)s") % locals()) raise exc.HTTPNotFound except (exception.AggregateHostExists, exception.InvalidAggregateAction): - LOG.exception(_("Cannot add host %(host)s in aggregate " + LOG.info(_("Cannot add host %(host)s in aggregate " "%(id)s") % locals()) raise exc.HTTPConflict return self._marshall_aggregate(aggregate) @@ -167,11 +167,11 @@ class AggregateController(object): try: aggregate = self.api.remove_host_from_aggregate(context, id, host) except (exception.AggregateNotFound, exception.AggregateHostNotFound): - LOG.exception(_("Cannot remove host %(host)s in aggregate " + LOG.info(_("Cannot remove host %(host)s in aggregate " "%(id)s") % locals()) raise exc.HTTPNotFound except exception.InvalidAggregateAction: - LOG.exception(_("Cannot remove host %(host)s in aggregate " + LOG.info(_("Cannot remove host %(host)s in aggregate " "%(id)s") % locals()) raise exc.HTTPConflict return self._marshall_aggregate(aggregate) @@ -191,7 +191,7 @@ class AggregateController(object): aggregate = self.api.update_aggregate_metadata(context, id, metadata) except exception.AggregateNotFound: - LOG.exception(_("Cannot set metadata %(metadata)s in aggregate " + LOG.info(_("Cannot set metadata %(metadata)s in aggregate " "%(id)s") % locals()) raise exc.HTTPNotFound -- cgit