Fixed KeyError crash in mailer.py
authorEd Bartosh <eduard.bartosh@intel.com>
Fri, 4 Oct 2013 09:38:01 +0000 (12:38 +0300)
committerGerrit Code Review <gerrit2@otctools.jf.intel.com>
Wed, 9 Oct 2013 06:23:47 +0000 (23:23 -0700)
commita7daa673ba1a17e3983489a7afa85599c11c086e
tree049734015b5fb4931f7669fbc3299e7ea2dd7ee6
parentc022ddbdadf20bd98cb622896cf57ee3453f60e9
Fixed KeyError crash in mailer.py

Looks like event, which comes from obs plugin doesn't have
'origintype' field.

====Notify the tag owner====================================
Traceback (most recent call last):
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 315, in <module>
    sys.exit(main())
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 282, in main
    notify_submiter(event_fields, data)
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 261, in notify_submiter
    os.getenv('EMAIL_TEMPLATES_DIR'))
  File "/srv/jenkins/jenkins-scripts/requests/mailer.py", line 238, in mailer
    if not tri['cond'] or tri['cond'](_bs, request):
  File "/srv/jenkins/jenkins-scripts/requests/mailer.py", line 58, in <lambda>
    'cond':  lambda bs, req: req['origintype'] == 'change_devel',
KeyError: 'origintype'

Change-Id: I28f3866c3b37b7782576c9e613c8904050053526
requests/mailer.py