zerovm/zerocloud — pull request #57 by pkit (2014-05-01 19:54:38+00:00)
Title: fixed bad behavior when rewriting output

In case where output device has `Content-Type` : `message/cgi` or 'message/http` and it's a `WRITABLE` device and it is a local device the file needs to be rewritten on disk

Why?

Because if it's a writeble local file it will be relocated to be an object in-place and then we need to delete all the `message` headers from it. Headers are only needed when such object is sent back over HTTP, but not when it's stored.
To rewrite such object we used mkstemp() which creates a file in `/tmp` by default. But according to Swift rename rules temp object must be on the same device as the intended real object.
This patch uses mkstemp(dir=swift_temp_dir) which places the temp files in a correct dir