From c945d60d1692d5c3c4a9e34c714217a7844cf61c Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 7 Nov 2012 14:11:33 -0500 Subject: [PATCH] zephyr_mirror: Make the logging options require the log path as an argument. This is for supporting running the mirroring bot on a server without AFS. (imported from commit 400bf32f17aca984fa40c3b1222893214497eaa0) --- bots/zephyr_mirror.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index 418cfd0..b479cfa 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -310,8 +310,8 @@ def zephyr_to_humbug(options): if subscribed_to_mail_messages(): zephyr_subscribe_autoretry(("mail", "inbox", "%me%")) - if options.resend_log: - with open('/mit/tabbott/Private/zephyrs', 'r') as log: + if options.resend_log_path is not None: + with open(options.resend_log_path, 'r') as log: for ln in log: try: zeph = simplejson.loads(ln) @@ -338,8 +338,8 @@ def zephyr_to_humbug(options): print "%s: zephyr=>humbug: Starting receive loop." % (datetime.datetime.now(),) - if options.enable_log: - log_file = "/mit/tabbott/Private/zephyrs" + if options.log_path is not None: + log_file = options.log_path else: log_file = "/dev/null" @@ -546,15 +546,15 @@ if __name__ == "__main__": help=optparse.SUPPRESS_HELP, action='store_true') parser.add_option('--resend-log', - dest='resend_log', - default=False, + dest='resend_log_path', + default=None, help=optparse.SUPPRESS_HELP, - action='store_true') + action='store') parser.add_option('--enable-log', - dest='enable_log', - default=False, + dest='log_path', + default=None, help=optparse.SUPPRESS_HELP, - action='store_true') + action='store') parser.add_option('--no-forward-personals', dest='forward_personals', help=optparse.SUPPRESS_HELP,