2 from invirt.database import *
3 from email.mime.text import MIMEText
5 message = """One of the four XVM servers, aperture-science, spontaneously rebooted
6 today at around 2:55 today. As of now, we're not sure what the cause of
9 Your VM %s was running on aperture-science. We have restarted it.
11 We realize that this is an inconvenience for you, and we apologize for
12 the unexpected downtime.
17 vms = "nforrest0 remus ghost-of-golezan tabbott 6470 dh moo mclamb dt-web htns uav-team x lsmb twopi what esg panache gardiner mailman-acl jack-o-tron knowledge ephialtes ocaml happy-go-lucky maridia cochese ocelot ecprice bibix groovy r privoxy thebes intrepid-paravirt-test qren2 quentin woodrow prolix oculus shinnyih gkovacs".split()
20 contact = Machine.query.filter_by(name=vm).first().contact
21 if '@' not in contact:
23 msg = MIMEText(message % vm)
25 msg['CC'] = 'XVM <xvm@mit.edu>'
26 msg['Reply-To'] = 'XVM <xvm@mit.edu>'
27 msg['From'] = 'Evan Broder <broder@mit.edu>'
28 msg['Subject'] = '[xvm] Unexpected reboot of your VM %s' % vm
29 s.sendmail('Evan Broder <broder@mit.edu>',
30 [contact, 'xvm@mit.edu'],