From 36d5fabf296ebf784392fa96e89f4a1522124d90 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 7 Nov 2012 15:37:46 -0500 Subject: [PATCH] zephyr_mirror: Use os.path.join for constructing the root_path. (imported from commit d894ab68430e42233a7aa6b289f01e790f8c8586) --- api/bots/zephyr_mirror.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/bots/zephyr_mirror.py b/api/bots/zephyr_mirror.py index a222b1c3e1..418cfd0986 100755 --- a/api/bots/zephyr_mirror.py +++ b/api/bots/zephyr_mirror.py @@ -158,9 +158,9 @@ def update_subscriptions_from_humbug(): ensure_subscribed(stream) def maybe_restart_mirroring_script(): - if os.stat(options.root_path + "/stamps/restart_stamp").st_mtime > start_time or \ + if os.stat(os.path.join(options.root_path, "stamps", "restart_stamp")).st_mtime > start_time or \ ((options.user == "tabbott" or options.user == "tabbott/extra") and - os.stat(options.root_path + "/stamps/tabbott_stamp").st_mtime > start_time): + os.stat(os.path.join(options.root_path, "stamps", "tabbott_stamp")).st_mtime > start_time): print print "%s: zephyr mirroring script has been updated; restarting..." % \ (datetime.datetime.now()) @@ -168,8 +168,8 @@ def maybe_restart_mirroring_script(): while True: try: if bot_name == "extra_mirror.py": - os.execvp(options.root_path + "/extra_mirror.py", sys.argv) - os.execvp(options.root_path + "/user_root/zephyr_mirror.py", sys.argv) + os.execvp(os.path.join(options.root_path, "extra_mirror.py"), sys.argv) + os.execvp(os.path.join(options.root_path, "user_root", "zephyr_mirror.py"), sys.argv) except: print "Error restarting, trying again." traceback.print_exc() @@ -595,8 +595,8 @@ if __name__ == "__main__": action='store') (options, args) = parser.parse_args() - sys.path[:0] = [options.root_path, options.root_path + "/python-zephyr", - options.root_path + "/python-zephyr/build/lib.linux-x86_64-2.6/"] + sys.path[:0] = [options.root_path, os.path.join(options.root_path, "python-zephyr"), + os.path.join(options.root_path, "python-zephyr/build/lib.linux-x86_64-2.6/")] # In case this is an automated restart of the mirroring script, # and we have lost AFS tokens, first try reading the API key from