msg['CC'] = 'XVM <xvm@mit.edu>'
msg['Reply-To'] = 'XVM <xvm@mit.edu>'
msg['From'] = opts.from_addr
- msg['Subject'] = '[xvm] Unexpected reboot of your VM %s' % vm
+ msg['Subject'] = opts.subject % vm
smtp.sendmail(opts.from_addr,
[contact, 'xvm@mit.edu'],
msg.as_string())
type = 'string',
dest = 'message',
help = 'filename with body of message')
+ parser.add_option('-s', '--subject',
+ type = 'string',
+ dest = 'subject',
+ default = '[xvm] Unexpected reboot of your VM %s',
+ help = 'subject line of message; %s for VM name')
parser.add_option('-f', '--from',
type = 'string',
dest = 'from_addr',