aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/autobuilder/buildsteps/SendOePerfEmail.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/site-packages/autobuilder/buildsteps/SendOePerfEmail.py')
-rw-r--r--lib/python2.7/site-packages/autobuilder/buildsteps/SendOePerfEmail.py64
1 files changed, 0 insertions, 64 deletions
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/SendOePerfEmail.py b/lib/python2.7/site-packages/autobuilder/buildsteps/SendOePerfEmail.py
deleted file mode 100644
index 60543973..00000000
--- a/lib/python2.7/site-packages/autobuilder/buildsteps/SendOePerfEmail.py
+++ /dev/null
@@ -1,64 +0,0 @@
-from buildbot.steps.shell import ShellCommand
-from buildbot.process.buildstep import SKIPPED
-import os, subprocess
-
-class SendOePerfEmail(ShellCommand):
- haltOnFailure = False
- flunkOnFailure = True
- name = "SendOePerfEmail"
- description = ["Sending Performance Email"]
- def __init__(self, factory, argdict=None, **kwargs):
- self.factory = factory
- description = ["Sending alert emails"]
- for k, v in argdict.iteritems():
- setattr(self, k, v)
- # Timeout needs to be passed to LoggingBuildStep as a kwarg
- self.timeout = 100000
- kwargs['timeout']=self.timeout
- ShellCommand.__init__(self, **kwargs)
-
- def start(self):
- if not os.environ.get("PERFORMANCE_SEND_EMAIL") == "True":
- return SKIPPED
-
- branch = self.getProperty("branch")
- oe_build_perf_test_output = self.getProperty("oe_build_perf_test_output")
- mailto = ""
- mailcc = ""
- mailbcc = ""
- mailsig = ""
- if os.environ.get('PERFORMANCE_MAIL_TO'):
- mailto = os.environ.get('PERFORMANCE_MAIL_TO')
- if os.environ.get('PERFORMANCE_MAIL_CC'):
- mailcc = os.environ.get('PERFORMANCE_MAIL_CC')
- if os.environ.get('PERFORMANCE_MAIL_BCC'):
- mailbcc = os.environ.get('PERFORMANCE_MAIL_BCC')
- if os.environ.get('PERFORMANCE_MAIL_SIG'):
- mailsig = os.environ.get('PERFORMANCE_MAIL_SIG')
-
- archive_dir = self.getProperty("oe_perf_archive_dir")
- globalres_log = self.getProperty("oe_perf_globalres_log")
- email_base = '''
-Running on %s \n
-
-%s
-
------------------\n\n Global results file \n\n""$read_file"" \n
------------------\n\n Archive results in %s \n''' % (oe_build_perf_test_output,
- os.uname()[1], archive_dir)
-
- mailsubject = "Build Performance Report - %s branch" % (branch)
- email_header = ""
- if mailto is not None and mailto is not "":
- email_header += "To: " + mailto + "\n"
- if mailcc is not None and mailcc is not "":
- email_header += "Cc: " + mailcc + "\n"
- if mailbcc is not None and mailbcc is not "":
- email_header += "Bcc: " + mailbcc + "\n"
-
- email_header += "Subject: " + mailsubject + "\n"
- mailcmd = 'read_file=`cat %s`;' %(globalres_log)
- mailcmd += ' echo "' + email_header + '\n' + email_base + '\n' + mailsig + '" | sendmail -t;'
- self.command = mailcmd
-
- ShellCommand.start(self)