Invalid key 'device_path' used in wait_for_path

Bug #1492936 reported by Peter Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-brick
Fix Released
Undecided
Peter Wang

Bug Description

when FC device is not found: wait_for_path will throw VolumeDeviceNotFound

but set invalid key 'device_path' for VolumeDeviceNotFound exception

    @utils.retry(exceptions=exception.VolumeDeviceNotFound)
    def wait_for_path(self, volume_path):
        """Wait for a path to show up."""
        LOG.debug("Checking to see if %s exists yet.",
                  volume_path)
        if not os.path.exists(volume_path):
            LOG.debug("%(path)s doesn't exists yet.", {'path': volume_path})
            raise exception.VolumeDeviceNotFound(
                volume_path=volume_path)
        else:
            LOG.debug("%s has shown up.", volume_path)

The accepted key is 'device'.

see below exception:

2015-09-07 01:21:39.741 ERROR os_brick.exception [req-85e9e4e2-ae07-4abd-aa69-a328a69170c7 None] code: 500
2015-09-07 01:21:39.742 ERROR os_brick.exception [req-85e9e4e2-ae07-4abd-aa69-a328a69170c7 None] volume_path: /dev/mapper/3600601607541390088f4e2212055e511
2015-09-07 01:21:41.745 ERROR os_brick.exception [req-85e9e4e2-ae07-4abd-aa69-a328a69170c7 None] Exception in string format operation. msg='Volume device not found at %(device)s.'
2015-09-07 01:21:41.745 19835 ERROR os_brick.exception Traceback (most recent call last):
2015-09-07 01:21:41.745 19835 ERROR os_brick.exception File "/usr/local/lib/python2.7/dist-packages/os_brick/exception.py", line 49, in __init__
2015-09-07 01:21:41.745 19835 ERROR os_brick.exception message = self.message % kwargs
2015-09-07 01:21:41.745 19835 ERROR os_brick.exception File "/usr/local/lib/python2.7/dist-packages/oslo_i18n/_message.py", line 168, in __mod__
2015-09-07 01:21:41.745 19835 ERROR os_brick.exception unicode_mod = self._safe_translate(six.text_type(self), params)
2015-09-07 01:21:41.745 19835 ERROR os_brick.exception File "/usr/local/lib/python2.7/dist-packages/oslo_i18n/_message.py", line 159, in _safe_translate
2015-09-07 01:21:41.745 19835 ERROR os_brick.exception translated_message = self.msgid % translated_params
2015-09-07 01:21:41.745 19835 ERROR os_brick.exception KeyError: 'device'
2015-09-07 01:21:41.745 19835 ERROR os_brick.exception

Thanks
Peter

Peter Wang (peter.wang)
Changed in os-brick:
assignee: nobody → Peter Wang (peter.wang)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-brick (master)

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

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

Reviewed: https://review.openstack.org/220902
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=0f3ec7c70a71d21aaf8db82b691255d68631785d
Submitter: Jenkins
Branch: master

commit 0f3ec7c70a71d21aaf8db82b691255d68631785d
Author: Peter Wang <email address hidden>
Date: Mon Sep 7 03:52:20 2015 -0400

    Use 'device' instead of 'volume_path'

    If device is not found at the first try,
    exception VolumeDeviceNotFound will be thrown.
    The exception VolumeDeviceNotFound expects the key 'device',
    however, 'volume_path' is passed in. As a result,
    KeyError: 'device' exception will be thrown.

    See the following definition in exception.py:
    class VolumeDeviceNotFound(CinderException):
        message = _('Volume device not found at %(device)s.')

    This bug is introduced in https://review.openstack.org/#/c/213389

    Change-Id: I64b37486631c31569fb037064c2ec0fee3bd855c
    Closes-Bug: #1492936

Changed in os-brick:
status: In Progress → Fix Committed
Changed in os-brick:
milestone: none → 0.5.0
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-brick 0.5.0

This issue was fixed in the openstack/os-brick 0.5.0 release.

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.