| 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 """Provides info about registered luci services.""" | 5 """Provides info about registered luci services.""" |
| 6 | 6 |
| 7 from google.appengine.ext import ndb | 7 from google.appengine.ext import ndb |
| 8 | 8 |
| 9 from components import config | 9 from components import config |
| 10 from components import net | 10 from components import net |
| 11 from components import utils | 11 from components import utils |
| 12 from components.config.proto import service_config_pb2 | 12 from components.config.proto import service_config_pb2 |
| 13 | 13 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 if not service.metadata_url: | 86 if not service.metadata_url: |
| 87 raise ndb.Return(service_config_pb2.ServiceDynamicMetadata()) | 87 raise ndb.Return(service_config_pb2.ServiceDynamicMetadata()) |
| 88 | 88 |
| 89 try: | 89 try: |
| 90 res = yield net.json_request_async( | 90 res = yield net.json_request_async( |
| 91 service.metadata_url, scopes=net.EMAIL_SCOPE) | 91 service.metadata_url, scopes=net.EMAIL_SCOPE) |
| 92 except net.Error as ex: | 92 except net.Error as ex: |
| 93 raise DynamicMetadataError('Net error: %s' % ex.message) | 93 raise DynamicMetadataError('Net error: %s' % ex.message) |
| 94 raise ndb.Return(_dict_to_dynamic_metadata(res)) | 94 raise ndb.Return(_dict_to_dynamic_metadata(res)) |
| OLD | NEW |