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. -- Mailing list: https://launchpad.net/~nagios-charmers Post to : [email protected] Unsubscribe : https://launchpad.net/~nagios-charmers More help : https://help.launchpad.net/ListHelp

