Skip to content

Commit baa09bc

Browse files
committed
log2zulip: Clean up extra config path and add comments.
That extra complexity isn't particularly valuable.
1 parent b53dc5d commit baa09bc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

zulip/integrations/log2zulip/log2zulip

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,16 @@ if __name__ == "__main__":
100100
parser = zulip.add_default_arguments(argparse.ArgumentParser()) # type: argparse.ArgumentParser3
101101
parser.add_argument("--control-path", default="/etc/log2zulip.conf")
102102
args = parser.parse_args()
103-
# On posix systems, we set the config directory explicitly for legacy reasons.
104-
if not args.zulip_config_file and os.name == "posix":
105-
args.zulip_config_file = "/etc/log2zulip.zuliprc"
106103

107104
lock_path = os.path.join(temp_dir, "log2zulip.lock")
108105
if os.path.exists(lock_path):
106+
# This locking code is here to protect against log2zulip,
107+
# running in a cron job, ending up with multiple copies
108+
# running at the same time.
109109
print("Log2zulip lock held; not doing anything")
110110
sys.exit(0)
111111

112+
# TODO: Convert this locking code to use a standard context manager.
112113
try:
113114
open(lock_path, "w").write("1")
114115
zulip_client = zulip.init_from_options(args)

0 commit comments

Comments
 (0)