OLD | NEW |
1 # Copyright 2014 The Swarming Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed by the Apache v2.0 license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """OS specific utility functions. | 5 """OS specific utility functions. |
6 | 6 |
7 Includes code: | 7 Includes code: |
8 - to declare the current system this code is running under. | 8 - to declare the current system this code is running under. |
9 - to run a command on user login. | 9 - to run a command on user login. |
10 - to restart the host. | 10 - to restart the host. |
11 | 11 |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 | 1238 |
1239 | 1239 |
1240 def trim_rolled_log(name): | 1240 def trim_rolled_log(name): |
1241 try: | 1241 try: |
1242 for item in glob.iglob('%s.??' % name): | 1242 for item in glob.iglob('%s.??' % name): |
1243 os.remove(item) | 1243 os.remove(item) |
1244 for item in glob.iglob('%s.???' % name): | 1244 for item in glob.iglob('%s.???' % name): |
1245 os.remove(item) | 1245 os.remove(item) |
1246 except Exception as e: | 1246 except Exception as e: |
1247 logging.exception('trim_rolled_log(%s) failed: %s', name, e) | 1247 logging.exception('trim_rolled_log(%s) failed: %s', name, e) |
OLD | NEW |