russss/Herd — pull request #19 by spajus (2014-08-12 12:33:22+00:00)
Title: Prevent mkdir failure due to race condition

When `hostlist` contains significant amount of servers, race conditions start to occur - multiple threads check `if not os.path.exists(opts['log_dir'])` and try to `os.makedirs(opts['log_dir'])`, and those threads that got that path does not exist but lose the race end up crashing, files don't get uploaded to those hosts. This fix is probably not the most elegant one, but it deals with those race condtions.