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.
This commit is contained in:
parent
963e6d0ad8
commit
dc2132e629
|
@ -34,8 +34,6 @@ from zephyr_mirror_backend import parse_args
|
||||||
|
|
||||||
(options, args) = parse_args()
|
(options, args) = parse_args()
|
||||||
|
|
||||||
sys.path[:0] = [os.path.join(options.root_path, 'api')]
|
|
||||||
|
|
||||||
from types import FrameType
|
from types import FrameType
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -57,6 +55,7 @@ if options.sync_subscriptions:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if options.forward_class_messages and not options.noshard:
|
if options.forward_class_messages and not options.noshard:
|
||||||
|
# Needed to get access to zephyr.lib.parallel
|
||||||
sys.path.append("/home/zulip/zulip")
|
sys.path.append("/home/zulip/zulip")
|
||||||
if options.on_startup_command is not None:
|
if options.on_startup_command is not None:
|
||||||
subprocess.call([options.on_startup_command])
|
subprocess.call([options.on_startup_command])
|
||||||
|
|
|
@ -1028,9 +1028,6 @@ def parse_args():
|
||||||
parser.add_option('--user',
|
parser.add_option('--user',
|
||||||
default=os.environ["USER"],
|
default=os.environ["USER"],
|
||||||
help=optparse.SUPPRESS_HELP)
|
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',
|
parser.add_option('--stamp-path',
|
||||||
default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends",
|
default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends",
|
||||||
help=optparse.SUPPRESS_HELP)
|
help=optparse.SUPPRESS_HELP)
|
||||||
|
@ -1090,14 +1087,6 @@ if __name__ == "__main__":
|
||||||
logger = open_logger()
|
logger = open_logger()
|
||||||
configure_logger(logger, "parent")
|
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,
|
# In case this is an automated restart of the mirroring script,
|
||||||
# and we have lost AFS tokens, first try reading the API key from
|
# and we have lost AFS tokens, first try reading the API key from
|
||||||
# the environment so that we can skip doing a filesystem read.
|
# the environment so that we can skip doing a filesystem read.
|
||||||
|
|
Loading…
Reference in a new issue