Changeset 2276 for trunk/scripts
- Timestamp:
- Mar 26, 2009, 1:32:18 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/outage/outage-mail
r2275 r2276 18 18 msg = MIMEText(message % vm) 19 19 msg['To'] = contact 20 msg[' CC'] = 'XVM <xvm@mit.edu>'20 msg['From'] = opts.from_addr 21 21 msg['Reply-To'] = 'XVM <xvm@mit.edu>' 22 msg['From'] = opts.from_addr23 22 msg['Subject'] = opts.subject % vm 24 23 smtp.sendmail(opts.from_addr, 25 [contact, 'xvm@mit.edu'], 24 [contact], 25 msg.as_string()) 26 return msg.as_string() 27 28 def send_summary(smtp, opts, messages): 29 msg = MIMEText('\n\n\n'.join(messages)) 30 msg['To'] = 'xvm@mit.edu' 31 msg['From'] = opts.from_addr 32 msg['Subject'] = ("xvm outage-mail summary (%d): %s" 33 % (len(messages), opts.subject)) 34 smtp.sendmail(opts.from_addr, 35 ['xvm@mit.edu'], 26 36 msg.as_string()) 27 37 … … 66 76 s.connect() 67 77 78 messages = [] 68 79 for vm in vms: 69 send_mail(s, opts, message, vm) 80 messages.append(send_mail(s, opts, message, vm)) 81 send_summary(s, opts, messages) 70 82 71 83 s.close()
Note: See TracChangeset
for help on using the changeset viewer.