raise correct exception in validate_connector() call

Bug #1409580 reported by Huang Zhiteng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Huang Zhiteng

Bug Description

When Nova issues 'initialize_connection' API call to Cinder, it passes the connector info which should contains needed information like 'initiator ' for iSCSI based driver, 'wwnps' for FC based driver to Cinder. Cinder volume services would call self.driver.validate_connector() to verify the connector has information that driver requires. The problem is all drivers that implements this method would raise either VolumeBackendAPIException or VolumeDriverException currently. What makes things worse is Cinder volume manager catches all exceptions and raises VolumeBackendAPIException and this exception then bubbles up to API caller (Nova).

The fact that validate_connector() method is purely a input validation, I suggest we change exception we raise in cinder driver and cinder volume manager and returns InvalidInput when required information is missing.

Changed in cinder:
importance: Undecided → Medium
assignee: nobody → Huang Zhiteng (zhiteng-huang)
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/146374

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/146374
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=c7d97c4ad70cc49dd529a10c593fbd9b20f89d90
Submitter: Jenkins
Branch: master

commit c7d97c4ad70cc49dd529a10c593fbd9b20f89d90
Author: Zhiteng Huang <email address hidden>
Date: Mon Jan 12 13:27:15 2015 +0800

    Raise correct exception when validate_connector failed

    Cinder volume manager uses validate_connector() method to verify if required
    information is in connector when handling initialize_connection() request.
    validate_connector() is actually a pure input validation method, basically
    checking if 'initiator' or 'wwpns' is in connector if storage protocol is
    iSCSI or FC. However, when required information is missing, currently drivers
    raises either VolumeBackendAPIException or VolumeDriverException, which would
    then bubble up to API and then to user (Nova) as InternalServerError.

    This change adds a new exception - InvalidConnectorException, that drivers
    should raise when connector is found not valid. With that, Cinder API would
    raise BadRequest instead to user, suggesting things are missing in request.

    Change-Id: I4f04f5d0c558404836a2bd270f7f22f3f2d4f314
    Closes-bug: #1409580

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-2 → 2015.1.0
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.