service update catch wrong exception

Bug #1551101 reported by Lisa Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Low
Lisa Li

Bug Description

During service update api, it catches serviceNotFound exception.

https://github.com/openstack/cinder/blob/master/cinder/api/contrib/services.py#L224
 try:
            svc = objects.Service.get_by_args(context, host, binary_key)
....
        except exception.ServiceNotFound:
            raise webob.exc.HTTPNotFound(explanation=_("service not found"))

        ret_val.update({'host': host, 'service': service,
                        'binary': binary, 'status': status})

This is wrong. As objects.Service.get_by_args raises HostBinaryNotFound exception.

Lisa Li (lisali)
Changed in cinder:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

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

Reviewed: https://review.openstack.org/285908
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=802c5633e064ad7d79ae7e5aa0ffb2e1df60f96b
Submitter: Jenkins
Branch: master

commit 802c5633e064ad7d79ae7e5aa0ffb2e1df60f96b
Author: LisaLi <email address hidden>
Date: Mon Feb 29 15:12:18 2016 +0800

    Fix exception during service update

    The function objects.Service.get_by_args raises HostBinaryNotFound
    exception, but in service update function, it catches ServiceNotFound
    exception by mistake.

    This patch is to remove HostBinaryNotFound and use ServiceNotFound to make
    things simple and consistent.

    Change-Id: Ic2ef79ca03393f3b1eb5bb89d4ffcf92d76460c6
    Closes-bug: #1551101

Changed in cinder:
status: In Progress → Fix Released
wanghao (wanghao749)
Changed in cinder:
milestone: none → mitaka-3
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.