PipelineFX Forum

Qube! => Installation and Configuration => Topic started by: ajk48n on May 16, 2011, 08:50:34 PM

Title: email only on failed job
Post by: ajk48n 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
Title: Re: email only on failed job
Post by: jburk 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