| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2008 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 | 7 |
| 8 from buildbot import buildset | 8 from buildbot import buildset |
| 9 from buildbot.scheduler import BadJobfile | 9 from buildbot.scheduler import BadJobfile |
| 10 from buildbot.scheduler import TryBase | 10 from buildbot.scheduler import TryBase |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 diff = options.get('patch', None) | 72 diff = options.get('patch', None) |
| 73 root = options.get('root', None) | 73 root = options.get('root', None) |
| 74 clobber = options.get('clobber', False) | 74 clobber = options.get('clobber', False) |
| 75 # -pN argument to patch. | 75 # -pN argument to patch. |
| 76 patchlevel = options.get('patchlevel', 0) | 76 patchlevel = options.get('patchlevel', 0) |
| 77 branch = options.get('branch', None) | 77 branch = options.get('branch', None) |
| 78 revision = options.get('revision', None) | 78 revision = options.get('revision', None) |
| 79 buildsetID = options.get('reason', "%s: %s" % (user, job_name)) | 79 buildsetID = options.get('reason', "%s: %s" % (user, job_name)) |
| 80 builderNames = [] | 80 builderNames = [] |
| 81 if 'bot' in options: | 81 if 'bot' in options: |
| 82 builderNames = [ options['bot'] ] | 82 builderNames = options['bot'].split(',') |
| 83 # TODO(maruel): Don't select the builders right now if not specified. | 83 # TODO(maruel): Don't select the builders right now if not specified. |
| 84 builderNames = self.pools.Select(builderNames) | 84 builderNames = self.pools.Select(builderNames) |
| 85 tests = options.get('tests', None) | 85 tests = options.get('tests', None) |
| 86 log.msg('Choose %s for job %s' % (",".join(builderNames), buildsetID)) | 86 log.msg('Choose %s for job %s' % (",".join(builderNames), buildsetID)) |
| 87 if diff: | 87 if diff: |
| 88 patch = (patchlevel, diff, root) | 88 patch = (patchlevel, diff, root) |
| 89 else: | 89 else: |
| 90 patch = None | 90 patch = None |
| 91 jobstamp = TryJobStamp(branch=branch, revision=revision, patch=patch, | 91 jobstamp = TryJobStamp(branch=branch, revision=revision, patch=patch, |
| 92 author_name=user, author_emails=email, | 92 author_name=user, author_emails=email, |
| 93 job_name=job_name, tests=tests) | 93 job_name=job_name, tests=tests) |
| 94 return builderNames, jobstamp, buildsetID | 94 return builderNames, jobstamp, buildsetID |
| 95 | 95 |
| 96 def messageReceived(self, socket): | 96 def messageReceived(self, socket): |
| 97 """Process the received data and send the queue buildset.""" | 97 """Process the received data and send the queue buildset.""" |
| 98 try: | 98 try: |
| 99 builderNames, jobstamp, buildsetID = self.parseJob(socket) | 99 builderNames, jobstamp, buildsetID = self.parseJob(socket) |
| 100 except BadJobfile: | 100 except BadJobfile: |
| 101 log.msg("%s reports a bad job connection" % (self)) | 101 log.msg("%s reports a bad job connection" % (self)) |
| 102 log.err() | 102 log.err() |
| 103 return | 103 return |
| 104 reason = "'%s' try job" % buildsetID | 104 reason = "'%s' try job" % buildsetID |
| 105 bs = buildset.BuildSet(builderNames, jobstamp, reason=reason, | 105 bs = buildset.BuildSet(builderNames, jobstamp, reason=reason, |
| 106 bsid=buildsetID) | 106 bsid=buildsetID) |
| 107 self.parent.submitBuildSet(bs) | 107 self.parent.submitBuildSet(bs) |
| OLD | NEW |