Container delete cli would have not good format exception message

Bug #1453709 reported by Kai Qiang Wu(Kennan)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Undecided
Kai Qiang Wu(Kennan)

Bug Description

Right now, the container delete cli would have following message(when the id not exist)

ubuntu@magtest:/opt/stack/magnum$ magnum container-delete 1b558c54-a68f-4221-aa8a-23e3a00c5745
Delete for container 1b558c54-a68f-4221-aa8a-23e3a00c5745 failed: Container 1b558c54-a68f-4221-aa8a-23e3a00c5745 could not be found.
Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
    executor_callback))

  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
    executor_callback)

  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
    result = func(ctxt, **new_args)

  File "/opt/stack/magnum/magnum/conductor/handlers/docker_conductor.py", line 112, in container_delete
    docker = self.get_docker_client(context, container_uuid)

  File "/opt/stack/magnum/magnum/conductor/handlers/docker_conductor.py", line 88, in get_docker_client
    container = objects.Container.get_by_uuid(context, container)

  File "/opt/stack/magnum/magnum/objects/base.py", line 109, in wrapper
    result = fn(cls, context, *args, **kwargs)

  File "/opt/stack/magnum/magnum/objects/container.py", line 72, in get_by_uuid
    db_container = cls.dbapi.get_container_by_uuid(context, uuid)

  File "/opt/stack/magnum/magnum/db/sqlalchemy/api.py", line 457, in get_container_by_uuid
    raise exception.ContainerNotFound(container=container_uuid)

ContainerNotFound: Container 1b558c54-a68f-4221-aa8a-23e3a00c5745 could not be found.
 (HTTP 404)

Usually we need like this
ubuntu@magtest:/opt/stack/magnum$ magnum container-delete 1b558c54-a68f-4221-aa8a-23e3a00c5745
Delete for container 1b558c54-a68f-4221-aa8a-23e3a00c5745 failed: Container 1b558c54-a68f-4221-aa8a-23e3a00c5745 could not be found.

Changed in magnum:
assignee: nobody → Kai Qiang Wu(Kennan) (wkqwu)
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/181825

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/181825
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=8b6893e7fbdeb799f025f95b9dff55ed8265e17a
Submitter: Jenkins
Branch: master

commit 8b6893e7fbdeb799f025f95b9dff55ed8265e17a
Author: HackToday <email address hidden>
Date: Mon May 11 16:33:29 2015 +0800

    Fix the container delete uuid issue

    Query db first to make sure container exist or not, and then
    call remote api for container

    Closes-Bug: #1453709
    Change-Id: Ib74120a5d7f560e878b7dd26183173679c6cc75c

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.