Volume discovery and local storage management lib
Go to file
Gorka Eguileor cad9fb0795 Protect against race within os.path.realpath
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
(cherry picked from commit de89635ab7)
2017-11-06 17:22:21 +00:00
doc/source Retire ISERConnector from documentation 2016-04-27 05:48:08 -04:00
etc/os-brick/rootwrap.d Trivial rootwrap -> privsep replacement 2016-04-15 15:29:25 +00:00
os_brick Protect against race within os.path.realpath 2017-11-06 17:22:21 +00:00
releasenotes Add open-iscsi manual scan support 2017-06-16 16:09:35 +02:00
tools Stop ignoring H405 hacking rule in tox 2017-05-24 00:44:57 +02:00
.coveragerc Fix coverage generation 2016-04-20 15:52:31 +00:00
.gitignore Add ignore for . directories 2016-07-22 17:02:41 +00:00
.gitreview Update .gitreview for stable/pike 2017-07-28 21:04:01 +00:00
.mailmap Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
.testr.conf Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
CONTRIBUTING.rst Update the documentation for os-brick 2015-02-19 14:37:13 -08:00
HACKING.rst Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
LICENSE Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
README.rst Show team and repo badges on README 2016-11-25 13:40:47 +01:00
babel.cfg Created the Brick library from Cinder 2015-01-22 19:09:30 +00:00
bindep.txt Add libssl to bindep 2017-06-08 06:14:15 -05:00
pylintrc Add pylint tox env 2016-04-04 18:02:19 -04:00
requirements.txt Updated from global requirements 2017-08-11 19:03:29 +00:00
setup.cfg Add Python 3.5 classifier and venv 2017-01-23 08:21:39 +07:00
setup.py Updated from global requirements 2017-03-10 19:12:09 +00:00
test-requirements.txt Updated from global requirements 2017-06-27 12:19:31 +00:00
tox.ini Update UPPER_CONSTRAINTS_FILE for stable/pike 2017-07-28 21:04:01 +00:00

README.rst

Team and repository tags

image

brick

Latest Version

Downloads

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:

http://docs.openstack.org/developer/os-brick/index.html

OR refer to the parent project, Cinder:

http://docs.openstack.org/developer/cinder/