magnum cmd should print more graceful error message

Bug #1507972 reported by Ma Wen Cheng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Undecided
Ma Wen Cheng

Bug Description

run magnum command with unreasonable parameters, it will print some error tracback message to the screen which is not needed.
we can only print these message in debug mode.

ubuntu@ubuntu14:~$ magnum baymodel-show 111
ERROR: Baymodel 111 could not be found.
Traceback (most recent call last):

  File "/opt/stack/magnum/magnum/conductor/handlers/indirection_api.py", line 31, in _object_dispatch
    return getattr(target, method)(context, *args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 171, in wrapper
    result = fn(cls, context, *args, **kwargs)

  File "/opt/stack/magnum/magnum/objects/baymodel.py", line 125, in get_by_name
    db_baymodel = cls.dbapi.get_baymodel_by_name(context, name)

  File "/opt/stack/magnum/magnum/db/sqlalchemy/api.py", line 355, in get_baymodel_by_name
    raise exception.BayModelNotFound(baymodel=baymodel_name)

BayModelNotFound: Baymodel 111 could not be found.
 (HTTP 404)

it should be like the following, looks better
ubuntu@ubuntu14:~$ nova show 111
ERROR (CommandError): No server with a name or ID of '111' exists.

Ma Wen Cheng (mars914)
Changed in magnum:
assignee: nobody → Ma Wen Cheng (mars914)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/237844

Changed in magnum:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/237844
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=a5df0e56b09dd152d2e6dc278c021b8831f4e41f
Submitter: Jenkins
Branch: master

commit a5df0e56b09dd152d2e6dc278c021b8831f4e41f
Author: wenchma <email address hidden>
Date: Wed Oct 21 09:41:29 2015 +0800

    Update devstack doc to cover the latest atomic image

    Change-Id: Ie142a190b9771ffe7d0512a6d49e5c56c90e0f69
    Closes-bug: #1507972

Changed in magnum:
status: In Progress → Fix Committed
Adrian Otto (aotto)
Changed in magnum:
milestone: none → mitaka-1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.