forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemail-sync-discrepancies
More file actions
executable file
·37 lines (24 loc) · 986 Bytes
/
email-sync-discrepancies
File metadata and controls
executable file
·37 lines (24 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
import sys, os, sys
import syslog
# boilerplate
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path = [ basedir ] + sys.path
os.environ["DJANGO_SETTINGS_MODULE"] = "ietf.settings"
virtualenv_activation = os.path.join(basedir, "env", "bin", "activate_this.py")
if os.path.exists(virtualenv_activation):
execfile(virtualenv_activation, dict(__file__=virtualenv_activation))
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-t", "--to", dest="to",
help="Email address to send report to", metavar="EMAIL")
options, args = parser.parse_args()
syslog.openlog(os.path.basename(__file__), syslog.LOG_PID, syslog.LOG_USER)
import django
django.setup()
from ietf.sync.mails import email_discrepancies
receivers = ["iesg-secretary@ietf.org"]
if options.to:
receivers = [options.to]
email_discrepancies(receivers)
syslog.syslog("Emailed sync discrepancies to %s" % receivers)