]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Improve use of temporary_file and temporary_dir
authorgit-harry <git-harry@live.co.uk>
Tue, 9 Dec 2014 11:26:20 +0000 (11:26 +0000)
committergit-harry <git-harry@live.co.uk>
Tue, 9 Dec 2014 16:57:45 +0000 (16:57 +0000)
commit297794bfbf3dc73b5667c0b34ab3a4f0e7bf43dd
tree5346c89b789d42082e9d85d592ab13301d3df19e
parent4f27af39d313b3545f419062146fb3ab2ad498d2
Improve use of temporary_file and temporary_dir

cinder/image/image_utils.py contains the functions temporary_file and
temporary_dir for use with handling temporary data.

temporary_file automatically creates files in CONF.image_conversion_dir
and will create CONF.image_conversion_dir if required. This commit
removes duplicate code that checks for/creates the dir before calling
temporary_file. This commit also replaces code that duplicates the
functionality of temporary_file with temporary_file.

temporary_dir requires that CONF.image_conversion_dir exists. This
commit adds a check to the function that creates it if it is missing.

Change-Id: Idecba85e19a0fe16dfc9f840913857137bfeee1b
cinder/image/image_utils.py
cinder/tests/test_image_utils.py
cinder/tests/test_sheepdog.py
cinder/tests/windows/test_windows.py
cinder/volume/drivers/sheepdog.py
cinder/volume/drivers/windows/windows.py