OLD | NEW |
1 # Copyright 2016 The Swarming Authors. All rights reserved. | 1 # Copyright 2016 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 """Lease management for machines leased from the Machine Provider. | 5 """Lease management for machines leased from the Machine Provider. |
6 | 6 |
7 Keeps a list of machine types which should be leased from the Machine Provider | 7 Keeps a list of machine types which should be leased from the Machine Provider |
8 and the list of machines of each type currently leased. | 8 and the list of machines of each type currently leased. |
9 | 9 |
10 Swarming integration with Machine Provider | 10 Swarming integration with Machine Provider |
11 ========================================== | 11 ========================================== |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 logging.warning('Request ID fulfilled and expired: %s', request_id) | 372 logging.warning('Request ID fulfilled and expired: %s', request_id) |
373 lease_request_map.pop(request_id) | 373 lease_request_map.pop(request_id) |
374 else: | 374 else: |
375 # Lease request isn't processed yet. Just try again later. | 375 # Lease request isn't processed yet. Just try again later. |
376 logging.info( | 376 logging.info( |
377 'Request ID %s in state: %s', request_id, response['state']) | 377 'Request ID %s in state: %s', request_id, response['state']) |
378 | 378 |
379 machine_type.leases = sorted( | 379 machine_type.leases = sorted( |
380 lease_request_map.values(), key=lambda lease: lease.client_request_id) | 380 lease_request_map.values(), key=lambda lease: lease.client_request_id) |
381 machine_type.put() | 381 machine_type.put() |
OLD | NEW |