]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix exception handling in PureISCSIDriver
authorVictor A. Ying <victor.ying@purestorage.com>
Thu, 14 Aug 2014 22:03:58 +0000 (15:03 -0700)
committerVictor A. Ying <victor.ying@purestorage.com>
Thu, 14 Aug 2014 22:43:58 +0000 (15:43 -0700)
commitbe0cee3b95e875788cfc5561837cff766ca87bc7
tree66f8b3846fa333051e57a914fec856c6dee4807c
parent4b973e90e099d7ab66d3c10de2c32506d68e9f6c
Fix exception handling in PureISCSIDriver

PureISCSIDriver had some error logging messages that make use of empty
replacement fields "{}" in strings on which the .format() method is
called, as allowed in Python 2.7+. Python 2.6 requires explicitly
naming or enumerating fields, i.e., "{}" must be replaced with "{0}".
This change fixes this so PureISCSIDriver is Python 2.6 compatible.

PureISCSIDriver.terminate_connection() also changed to catch
errors raised by _get_host_name(). Exception handling generally changed
to be more correct.

This change also adds testing of these code path to the unit tests,
to make sure it's actually correct.

Change-Id: I84179a8bc59dcf5593664ab11c90b07c451fd360
Closes-Bug: 1357004
cinder/tests/test_pure.py
cinder/volume/drivers/pure.py