From dc2132e629adcf1d14672c17df8ac86cdb4b7e2f Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 5 Oct 2017 13:23:17 -0700 Subject: [PATCH] zephyr_mirror: Eliminate --root-path arguments. These were quite messy code, and now that almost nobody is running their own zephyr mirroring script (vs. using webathena), making the zephyr mirroring script deployable outside the package isn't super valuable. --- zulip/integrations/zephyr/zephyr_mirror.py | 3 +-- zulip/integrations/zephyr/zephyr_mirror_backend.py | 11 ----------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/zulip/integrations/zephyr/zephyr_mirror.py b/zulip/integrations/zephyr/zephyr_mirror.py index 7b4dc53..2a023dd 100755 --- a/zulip/integrations/zephyr/zephyr_mirror.py +++ b/zulip/integrations/zephyr/zephyr_mirror.py @@ -34,8 +34,6 @@ from zephyr_mirror_backend import parse_args (options, args) = parse_args() -sys.path[:0] = [os.path.join(options.root_path, 'api')] - from types import FrameType from typing import Any @@ -57,6 +55,7 @@ if options.sync_subscriptions: sys.exit(0) if options.forward_class_messages and not options.noshard: + # Needed to get access to zephyr.lib.parallel sys.path.append("/home/zulip/zulip") if options.on_startup_command is not None: subprocess.call([options.on_startup_command]) diff --git a/zulip/integrations/zephyr/zephyr_mirror_backend.py b/zulip/integrations/zephyr/zephyr_mirror_backend.py index 22d0830..cfae3b6 100755 --- a/zulip/integrations/zephyr/zephyr_mirror_backend.py +++ b/zulip/integrations/zephyr/zephyr_mirror_backend.py @@ -1028,9 +1028,6 @@ def parse_args(): parser.add_option('--user', default=os.environ["USER"], help=optparse.SUPPRESS_HELP) - parser.add_option('--root-path', - default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends", - help=optparse.SUPPRESS_HELP) parser.add_option('--stamp-path', default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends", help=optparse.SUPPRESS_HELP) @@ -1090,14 +1087,6 @@ if __name__ == "__main__": logger = open_logger() configure_logger(logger, "parent") - # The 'api' directory needs to go first, so that 'import zulip' won't pick - # up some other directory named 'humbug'. - pyzephyr_lib_path = "python-zephyr/build/lib.linux-%s-%s/" % (os.uname()[4], sys.version[0:3]) - sys.path[:0] = [os.path.join(options.root_path, 'api'), - options.root_path, - os.path.join(options.root_path, "python-zephyr"), - os.path.join(options.root_path, pyzephyr_lib_path)] - # In case this is an automated restart of the mirroring script, # and we have lost AFS tokens, first try reading the API key from # the environment so that we can skip doing a filesystem read.