3 from invirt.database import *
4 from email.mime.text import MIMEText
6 sender = 'Greg Price <price@mit.edu>'
7 sendername = sender.split()[0]
8 host = 'arklay-mansion'
11 One of the four XVM host servers, %s, failed tonight at
12 about 23:17 and was rebooted. We're working to understand the cause.
14 Your VM %%s was running on %s. We have restarted it.
16 We realize that this is an inconvenience for you, and we apologize for
17 the unexpected downtime.
21 """ % (host, host, sendername)
23 vms = "amd64-test brain-trust cluster-test david-vista debathena-livecd-build ecprice gradbook greg-ns1 greg-ns2 groovy htns iodine jsoltren latex liftm medkaz mhd mksvn niska polarix price-lenny price-test8 qren2 shawn-of-awesome staxowax tdc tdc-secure thesecrete tor transistor watmap".split()
26 contact = Machine.query.filter_by(name=vm).first().contact
27 if '@' not in contact:
29 msg = MIMEText(message % vm)
31 msg['CC'] = 'XVM <xvm@mit.edu>'
32 msg['Reply-To'] = 'XVM <xvm@mit.edu>'
34 msg['Subject'] = '[xvm] Unexpected reboot of your VM %s' % vm
36 [contact, 'xvm@mit.edu'],