]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Check if dir exists before calling listdir
authorJohn Griffith <john.griffith@solidfire.com>
Thu, 24 Oct 2013 00:04:51 +0000 (18:04 -0600)
committerJohn Griffith <john.griffith@solidfire.com>
Thu, 24 Oct 2013 00:04:51 +0000 (18:04 -0600)
commit1766a5acc5c948288b4cd81c62d0c1507c55f727
tree9eeca5ed6cca2bdf9e4df4d434c462db68e63901
parentc037605555b0635755e6c90cc77c0df893052015
Check if dir exists before calling listdir

Changes along the way to how we clean up and detach after
copying an image to a volume exposed a problem in the cleanup
of the brick/initiator routines.

The clean up in the initiator detach was doing a blind listdir
of /dev/disk/by-path, however due to detach and cleanup being
called upon completion of the image download to the volume if
there are no other devices mapped in this directory the directory
is removed.

The result was that even though the create and copy of the image
was succesful, the HostDriver code called os.lisdir on a directory
that doesn't exist any longer and raises an unhandled exception that
cause the taskflow mechanism to mark the volume as failed.

Change-Id: I488755c1a49a77f42efbb58a7a4eb6f4f084df07
Closes-bug: #1243980
cinder/brick/initiator/host_driver.py