Rewrote run_buildslave shell script in Python