| OLD | NEW |
| 1 # Copyright 2015 The LUCI Authors. All rights reserved. | 1 # Copyright 2015 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 """Datastore models for the Machine Provider messages.""" | 5 """Datastore models for the Machine Provider messages.""" |
| 6 | 6 |
| 7 import hashlib | 7 import hashlib |
| 8 | 8 |
| 9 from google.appengine.ext import ndb | 9 from google.appengine.ext import ndb |
| 10 from google.appengine.ext.ndb import msgprop | 10 from google.appengine.ext.ndb import msgprop |
| 11 | 11 |
| 12 from protorpc import messages | 12 from protorpc import messages |
| 13 from protorpc import protobuf | 13 from protorpc import protobuf |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 Args: | 241 Args: |
| 242 *filters: Any additional filters to include in the query. | 242 *filters: Any additional filters to include in the query. |
| 243 | 243 |
| 244 Yields: | 244 Yields: |
| 245 CatalogMachineEntry keys in no guaranteed order. | 245 CatalogMachineEntry keys in no guaranteed order. |
| 246 """ | 246 """ |
| 247 available = cls.state == CatalogMachineEntryStates.AVAILABLE | 247 available = cls.state == CatalogMachineEntryStates.AVAILABLE |
| 248 for machine in cls.query(available, *filters).fetch(keys_only=True): | 248 for machine in cls.query(available, *filters).fetch(keys_only=True): |
| 249 yield machine | 249 yield machine |
| OLD | NEW |