Fix typo in image_utils tempfile handling
Commit cbcd340 changed from NamedTemporaryFile to mkstemp, but
mkstemp returns a file descripter, not a file object. We therefore
need to close the fd using os.close(). This was tested using
devstack.
Change-Id: I808fa470a141e249fe30ee762ee94f47ecfd3f63
This commit is contained in:
@@ -209,7 +209,7 @@ def fetch_to_raw(context, image_service,
|
||||
os.makedirs(FLAGS.image_conversion_dir)
|
||||
|
||||
fd, tmp = tempfile.mkstemp(dir=FLAGS.image_conversion_dir)
|
||||
fd.close()
|
||||
os.close(fd)
|
||||
with utils.remove_path_on_error(tmp):
|
||||
fetch(context, image_service, image_id, tmp, user_id, project_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user