
On iSCSI connections, when we are making sure that there no links remain like /dev/disk/by-id/scsi-* we make several calls to os.path.realpath which normal behavior is: - If file path doesn't exist, returns the same file path - If file path exists, return the real path But there is a third option, and that is when the file did exist but it dissapear right when the call to os.readlink in posixpath:_joinrealpath path, ok = _joinrealpath(path, os.readlink(newpath), seen) Which ends up raising an exception such as: OSError: [Errno 2] No such file or directory: '/dev/disk/by-id/scsi-20024f40058540081' And because of this exception the detach will fail when it shouldn't. This patch adds includes the call to os.path.realpath within a try...except clause to prevent this race condition from unexpectely making the detach operation fail. Change-Id: Ieb58826b28c62094c941fce10863c0a75fb4e8aa Closes-Bug: #1719719
Team and repository tags
brick
OpenStack Cinder brick library for managing local volume attaches
Features
- Discovery of volumes being attached to a host for many transport protocols.
- Removal of volumes from a host.
Hacking
Hacking on brick requires python-gdbm (for Debian derived distributions), Python 2.7 and Python 3.4. A recent tox is required, as is a recent virtualenv (13.1.0 or newer).
If "tox -e py34" fails with the error "db type could not be determined", remove the .testrepository/ directory and then run "tox -e py34".
- For any other information, refer to the developer documents:
- OR refer to the parent project, Cinder:
- License: Apache License, Version 2.0
- Source: https://git.openstack.org/cgit/openstack/os-brick
- Bugs: https://bugs.launchpad.net/os-brick
Description
Languages
Python
99.6%
Shell
0.4%