← Back to team overview

nagios-charmers team mailing list archive

Re: [Merge] ~xavpaice/hw-health-charm:lp1833897 into hw-health-charm:master

 

Discussed this and I don't think we want to use either shutil.move or shutil.copyfile, as they don't provide atomicity guarantees and nrpe can trip over an incomplete file.

Instead, we should ensure the temporary file is on the same filesystem as the destination and stick with os.rename. The easiest way is to set TMP_OUTPUT_FILE to OUTPUT_FILE + ".tmp" instead of using the module global. Or use tempfile.TemporaryNamedFile(delete=False,dir=os.path.dirname(OUTPUT_FILE))
-- 
https://code.launchpad.net/~xavpaice/hw-health-charm/+git/hw-health-charm/+merge/369219
Your team Nagios Charm developers is subscribed to branch hw-health-charm:master.


References