~canonical-ci-engineering/adt-result-checker/trunk

« back to all changes in this revision

Viewing changes to adt_result_checker/__init__.py

  • Committer: Ubuntu CI Bot
  • Author(s): Celso Providelo
  • Date: 2015-03-19 14:12:42 UTC
  • mfrom: (4.2.2 trunk)
  • Revision ID: ubuntu_ci_bot-20150319141242-n9dgall977ltmf59
Adding missing message acknowledge when tests requests have to be retried.  [r=Paul Larson, Parameswaran Sivatharman]

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
                message,
74
74
                "Invalid result message format: {}".format(str(e))
75
75
            )
 
76
            message.ack()
76
77
        else:
77
78
            if exit_code_implies_retry(exit_code):
78
79
                self.maybe_retry_message(message)
 
80
                message.ack()
79
81
            else:
80
82
                if result_tarball_exists_in_swift(request_id):
81
 
                    if self.post_results(request_id):
82
 
                        message.ack()
83
 
                    else:
 
83
                    if not self.post_results(request_id):
84
84
                        self.maybe_retry_message(
85
85
                            message,
86
86
                            "Unable to post results to swift"
87
87
                        )
 
88
                    message.ack()
88
89
                else:
89
90
                    # Swift does not yet contain the result tarball, so we
90
91
                    # can't process this yet: put it back in the queue for
106
107
        # own simple queue that no one ever automatically reads from. This is
107
108
        # why we ack this message, even though we're really failing it.
108
109
        message.payload['deadletter_reason'] = reason
109
 
        message.ack()
110
110
 
111
111
        queue = self.connection.SimpleQueue('adt.deadletters.{}'.format(API_VERSION))
112
112
        queue.put(message.payload)