Skip to content

Commit dc2132e

Browse files
committed
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.
1 parent 963e6d0 commit dc2132e

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

zulip/integrations/zephyr/zephyr_mirror.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434

3535
(options, args) = parse_args()
3636

37-
sys.path[:0] = [os.path.join(options.root_path, 'api')]
38-
3937
from types import FrameType
4038
from typing import Any
4139

@@ -57,6 +55,7 @@ def die(signal, frame):
5755
sys.exit(0)
5856

5957
if options.forward_class_messages and not options.noshard:
58+
# Needed to get access to zephyr.lib.parallel
6059
sys.path.append("/home/zulip/zulip")
6160
if options.on_startup_command is not None:
6261
subprocess.call([options.on_startup_command])

zulip/integrations/zephyr/zephyr_mirror_backend.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,9 +1028,6 @@ def parse_args():
10281028
parser.add_option('--user',
10291029
default=os.environ["USER"],
10301030
help=optparse.SUPPRESS_HELP)
1031-
parser.add_option('--root-path',
1032-
default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends",
1033-
help=optparse.SUPPRESS_HELP)
10341031
parser.add_option('--stamp-path',
10351032
default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends",
10361033
help=optparse.SUPPRESS_HELP)
@@ -1090,14 +1087,6 @@ def die_gracefully(signal, frame):
10901087
logger = open_logger()
10911088
configure_logger(logger, "parent")
10921089

1093-
# The 'api' directory needs to go first, so that 'import zulip' won't pick
1094-
# up some other directory named 'humbug'.
1095-
pyzephyr_lib_path = "python-zephyr/build/lib.linux-%s-%s/" % (os.uname()[4], sys.version[0:3])
1096-
sys.path[:0] = [os.path.join(options.root_path, 'api'),
1097-
options.root_path,
1098-
os.path.join(options.root_path, "python-zephyr"),
1099-
os.path.join(options.root_path, pyzephyr_lib_path)]
1100-
11011090
# In case this is an automated restart of the mirroring script,
11021091
# and we have lost AFS tokens, first try reading the API key from
11031092
# the environment so that we can skip doing a filesystem read.

0 commit comments

Comments
 (0)