OLD | NEW |
1 # Copyright 2014 The LUCI 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 under the Apache License, Version 2.0 |
3 # found in the LICENSE file. | 3 # that can be 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 |
12 This file serves as an API to bot_config.py. bot_config.py can be replaced on | 12 This file serves as an API to bot_config.py. bot_config.py can be replaced on |
13 the server to allow additional server-specific functionality. | 13 the server to allow additional server-specific functionality. |
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 | 1261 |
1262 | 1262 |
1263 def trim_rolled_log(name): | 1263 def trim_rolled_log(name): |
1264 try: | 1264 try: |
1265 for item in glob.iglob('%s.??' % name): | 1265 for item in glob.iglob('%s.??' % name): |
1266 os.remove(item) | 1266 os.remove(item) |
1267 for item in glob.iglob('%s.???' % name): | 1267 for item in glob.iglob('%s.???' % name): |
1268 os.remove(item) | 1268 os.remove(item) |
1269 except Exception as e: | 1269 except Exception as e: |
1270 logging.exception('trim_rolled_log(%s) failed: %s', name, e) | 1270 logging.exception('trim_rolled_log(%s) failed: %s', name, e) |
OLD | NEW |