Author Topic: email only on failed job  (Read 3406 times)

ajk48n

  • Jr. Member
  • **
  • Posts: 7
email only on failed job
« on: May 16, 2011, 08:50:34 PM »
hi,

Is there a way to have qube email only when a job has failed, not when it has completed? And also, is there a way for the email to include any output that the program may have printed?

Thanks for the help,
Adam

jburk

  • Administrator
  • *****
  • Posts: 493
Re: email only on failed job
« Reply #1 on: May 27, 2011, 07:30:02 PM »
This is not currently supported in the QubeGUI or the command-line, but can be accomplished through the API:
Code: [Select]
import qb

job = {
    'prototype': 'cmdline',
    'package': {'cmdline': 'false'},
    'callbacks': [
        {
            'code': 'jburk@pipelinefx.com',
            'language': 'mail',
            'triggers': 'failed-job-self',
        }
    ],
}

for j in qb.submit(job):
    print 'id: %(id)s' % j