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.
MODIFY
zulip/integrations/zephyr/zephyr_mirror.py
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])

MODIFY
zulip/integrations/zephyr/zephyr_mirror_backend.py
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.

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.