]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Windows iSCSI driver: Fixes copy disk method exception handling
authorNashwan Azhari <nmouhammad@cloudbasesolutions.com>
Wed, 13 Aug 2014 14:46:45 +0000 (17:46 +0300)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 2 Feb 2015 16:04:56 +0000 (18:04 +0200)
commitb5567ed10a2e49adca849456049393120e375965
tree5690c31b6931617f79492de84d409865c6ab289a
parentbc8d0d2fcb5e917ad8d52dfadfbf87e161af3605
Windows iSCSI driver: Fixes copy disk method exception handling

In the copy_vhd_disk method, it is assumed that if the copy operation
fails, a wmi.x_wmi exception will be raised. This is wrong. In fact,
none of the methods called there can raise such an exception in those
circumstances.

At the moment, this method will not raise an exception even if the
copy operation fails.

This patch adds a check to see if the source image actually exists.
The according CIM_DataFile Copy method's return value is checked as
well in order to see if the operation failed or not.

Change-Id: I778ecd61adb007995b629b36044caac78cd16889
Closes-Bug: #1356398
cinder/tests/windows/test_windows_utils.py [new file with mode: 0644]
cinder/volume/drivers/windows/windows_utils.py