OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 | 5 |
6 # pylint: disable=W0201 | 6 # pylint: disable=W0201 |
7 | 7 |
8 | 8 |
9 from recipe_engine import recipe_api | 9 from recipe_engine import recipe_api |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 path = os.path.join(src, pattern) | 108 path = os.path.join(src, pattern) |
109 for f in glob.glob(path): | 109 for f in glob.glob(path): |
110 dst_path = os.path.join(dst, os.path.relpath(f, src)) | 110 dst_path = os.path.join(dst, os.path.relpath(f, src)) |
111 if not os.path.isdir(os.path.dirname(dst_path)): | 111 if not os.path.isdir(os.path.dirname(dst_path)): |
112 os.makedirs(os.path.dirname(dst_path)) | 112 os.makedirs(os.path.dirname(dst_path)) |
113 print 'Copying build product %%s to %%s' %% (f, dst_path) | 113 print 'Copying build product %%s to %%s' %% (f, dst_path) |
114 shutil.move(f, dst_path) | 114 shutil.move(f, dst_path) |
115 ''' % str(BUILD_PRODUCTS_ISOLATE_WHITELIST), | 115 ''' % str(BUILD_PRODUCTS_ISOLATE_WHITELIST), |
116 args=[src, dst], | 116 args=[src, dst], |
117 infra_step=True) | 117 infra_step=True) |
| 118 |
| 119 def with_retry(self, steptype, name, attempts, *args, **kwargs): |
| 120 for attempt in xrange(attempts): |
| 121 step_name = name |
| 122 if attempt > 0: |
| 123 step_name += ' (attempt %d)' % (attempt + 1) |
| 124 try: |
| 125 steptype(step_name, *args, **kwargs) |
| 126 return |
| 127 except self.m.step.StepFailure: |
| 128 if attempt == attempts - 1: |
| 129 raise |
OLD | NEW |