~joetalbott/+junk/add_txstatsd

« back to all changes in this revision

Viewing changes to ci-utils/ci_utils/amqp_worker.py

  • Committer: Chris Johnston
  • Author(s): Chris Johnston
  • Date: 2014-03-15 11:57:42 UTC
  • mfrom: (385.2.4 upload-swift)
  • Revision ID: chris_johnston-20140315115742-xb3hzwg72ti7k05i
[r=PS Jenkins bot, Andy Doan] Push build images to swift storage for later retrieval 1291036 from Chris Johnston

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
        try:
129
129
            name = '{}.output.log'.format(logger.name)
130
130
            url = store.put_file(name, content, 'text/plain')
131
 
            retval.setdefault('artifacts', []).append({
132
 
                'name': name,
133
 
                'reference': url,
134
 
                'type': 'LOGS',
135
 
            })
 
131
            self._create_artifact(name, url, retval)
136
132
        except:
137
133
            log.exception('unable to store worker log')
138
134
 
 
135
    def _create_artifact(self, name, url, retval, type='LOGS'):
 
136
        retval.setdefault('artifacts', []).append({
 
137
            'name': name,
 
138
            'reference': url,
 
139
            'type': type,
 
140
        })
 
141
 
139
142
    def _handle_cancel(self, params):
140
143
        '''provide an advisory mechansim to inform the worker to stop
141
144