]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Robustify writing iscsi target persistence file
authorMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Fri, 25 Sep 2015 16:38:23 +0000 (10:38 -0600)
committerMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Thu, 3 Dec 2015 00:13:58 +0000 (19:13 -0500)
commit0d47c8ec3a07f3311ed9dd3d54201b7c2b1d7292
tree9010e52b0566a5185d413ffb74f52a4155172f1d
parent0c5cce77bee5bd3ad21b1eb53d0e4d092001ff69
Robustify writing iscsi target persistence file

With the current code, it's possible to end up with a zero-size
persistence file (or even corruption of the contents) if the
process gets killed or the system takes a power outage.

Switch to a "write to temp file and rename" model for writing the
persistence file.  This will make it more robust against unclean
process termination or unclean system shutdown.

Change-Id: Ic4fdb5a9f6f622b2ab9658f7d4206e4c8ca55046
Closes-Bug: #1499795
cinder/tests/unit/targets/test_tgt_driver.py
cinder/tests/unit/test_utils.py
cinder/utils.py
cinder/volume/targets/cxt.py
cinder/volume/targets/tgt.py