X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=monitor%2Fwrapper%2Fmailer.py;h=cd04f3afc9991e2f143efe8c89497152983e00ce;hb=4063808abccd3f5da19dacdff16c1fce46361977;hp=4a0d661917f63b5ebfe9a0ff23a04ff98afdab7f;hpb=258e40c53d1f6e79ea92548765d65bbb74eba004;p=monitor.git diff --git a/monitor/wrapper/mailer.py b/monitor/wrapper/mailer.py index 4a0d661..cd04f3a 100755 --- a/monitor/wrapper/mailer.py +++ b/monitor/wrapper/mailer.py @@ -194,7 +194,8 @@ def emailViaRT(subject, text, to, ticket_id=None): cmd = "rt correspond -m - %s" % ticket_id print cmd (f_in, f_out, f_err) = os.popen3(cmd) - f_in.write(text) + #f_in.write(input[:32000]) + f_in.write(text[:32000]) f_in.flush() f_in.close() value = f_out.read() @@ -231,6 +232,7 @@ def emailViaRT_NoTicket(subject, text, to): input_text += "Queue: %s\n" % config.RT_QUEUE for recipient in to: input_text += "AdminCc: %s\n" % recipient + #input_text += "AdminCc: %s\n" % config.cc_email input_text += "Text: %s" # Add a space for each new line to get RT to accept the file. @@ -240,7 +242,12 @@ def emailViaRT_NoTicket(subject, text, to): cmd = "rt create -i -t ticket" print cmd (f_in, f_out, f_err) = os.popen3(cmd) - f_in.write(input_text % (subject, spaced_text)) + input = input_text % (subject, spaced_text) + print "length: %s" % len(input) + # NOTE: RT hangs with larger input, probably due to some internal + # buffering. So, chop off messages at 32000 + #f_in.write(input[:32000]) + f_in.write(input[:32000]) f_in.flush() f_in.close() value = f_out.read()