OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import re | 5 import re |
6 | 6 |
7 import buildbot | 7 import buildbot |
8 from buildbot.process.properties import Properties | 8 from buildbot.process.properties import Properties |
9 | 9 |
10 from twisted.python import log | 10 from twisted.python import log |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 options.setdefault('name', 'Unnamed') | 48 options.setdefault('name', 'Unnamed') |
49 options.setdefault('user', 'John Doe') | 49 options.setdefault('user', 'John Doe') |
50 options['email'] = [e for e in options.get('email', '').split(',') if e] | 50 options['email'] = [e for e in options.get('email', '').split(',') if e] |
51 for email in options['email']: | 51 for email in options['email']: |
52 if not TryJobBase._EMAIL_VALIDATOR.match(email): | 52 if not TryJobBase._EMAIL_VALIDATOR.match(email): |
53 log.msg("'%s' is an invalid email address!" % email) | 53 log.msg("'%s' is an invalid email address!" % email) |
54 raise BadJobfile("'%s' is an invalid email address!" % email) | 54 raise BadJobfile("'%s' is an invalid email address!" % email) |
55 | 55 |
56 options.setdefault('patch', None) | 56 options.setdefault('patch', None) |
57 options.setdefault('root', None) | 57 options.setdefault('root', None) |
58 options.setdefault('clobber', False) | 58 options.setdefault('clobber', None) |
59 # -pN argument to patch. | 59 # -pN argument to patch. |
60 options['patchlevel'] = int(options.get('patchlevel', 0)) | 60 options['patchlevel'] = int(options.get('patchlevel', 0)) |
61 options.setdefault('branch', None) | 61 options.setdefault('branch', None) |
62 options.setdefault('revision', None) | 62 options.setdefault('revision', None) |
63 options.setdefault('reason', '%s: %s' % (options['user'], options['name'])) | 63 options.setdefault('reason', '%s: %s' % (options['user'], options['name'])) |
64 options['testfilter'] = [ | 64 options['testfilter'] = [ |
65 i for i in options.get('testfilter', '').split(',') if i | 65 i for i in options.get('testfilter', '').split(',') if i |
66 ] | 66 ] |
67 options.setdefault('project', self.pools.default_pool_name) | 67 options.setdefault('project', self.pools.default_pool_name) |
68 options.setdefault('repository', None) | 68 options.setdefault('repository', None) |
(...skipping 14 matching lines...) Expand all Loading... |
83 return options | 83 return options |
84 | 84 |
85 def get_props(self, options): | 85 def get_props(self, options): |
86 """Current job extra properties that are not related to the source stamp. | 86 """Current job extra properties that are not related to the source stamp. |
87 Initialize with the Scheduler's base properties. | 87 Initialize with the Scheduler's base properties. |
88 """ | 88 """ |
89 props = Properties() | 89 props = Properties() |
90 # TODO(maruel): BROKEN ON BULDBOT 0.8.4p1 | 90 # TODO(maruel): BROKEN ON BULDBOT 0.8.4p1 |
91 # pylint: disable=E1101 | 91 # pylint: disable=E1101 |
92 props.updateFromProperties(self.properties) | 92 props.updateFromProperties(self.properties) |
93 props.setProperty('clobber', options['clobber'], 'Scheduler') | 93 if options['clobber'] is not None: |
| 94 props.setProperty('clobber', options['clobber'], 'Scheduler') |
94 if options['testfilter']: | 95 if options['testfilter']: |
95 props.setProperty('testfilters', options['testfilter'], 'Scheduler') | 96 props.setProperty('testfilters', options['testfilter'], 'Scheduler') |
96 return props | 97 return props |
OLD | NEW |