OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright 2015 The LUCI Authors. All rights reserved. | 2 # Copyright 2015 The LUCI Authors. All rights reserved. |
3 # Use of this source code is governed by the Apache v2.0 license that can be | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
4 # found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
5 | 5 |
6 """Machine Provider agent for GCE instances.""" | 6 """Machine Provider agent for GCE instances.""" |
7 | 7 |
8 import base64 | 8 import base64 |
9 import datetime | 9 import datetime |
10 import httplib2 | 10 import httplib2 |
11 import json | 11 import json |
12 import logging | 12 import logging |
13 import logging.handlers | 13 import logging.handlers |
14 import os | 14 import os |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 if ack_ids: | 275 if ack_ids: |
276 pubsub.acknowledge(subscription, project, ack_ids) | 276 pubsub.acknowledge(subscription, project, ack_ids) |
277 if time.time() - start_time < 1: | 277 if time.time() - start_time < 1: |
278 # Iterate at most once per second (chosen arbitrarily). | 278 # Iterate at most once per second (chosen arbitrarily). |
279 time.sleep(1) | 279 time.sleep(1) |
280 | 280 |
281 | 281 |
282 if __name__ == '__main__': | 282 if __name__ == '__main__': |
283 sys.exit(main()) | 283 sys.exit(main()) |
OLD | NEW |