| OLD | NEW |
| (Empty) |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 from recipe_engine.config import config_item_context, ConfigGroup | |
| 6 from recipe_engine.config import Single | |
| 7 | |
| 8 GS_BASE_URL = 'gs://chrome-amp-keys' | |
| 9 | |
| 10 def BaseConfig(**_kwargs): | |
| 11 return ConfigGroup( | |
| 12 pool = Single(basestring), | |
| 13 api_key_file_url = Single(basestring), | |
| 14 api_secret_file_url = Single(basestring), | |
| 15 ) | |
| 16 | |
| 17 config_ctx = config_item_context(BaseConfig) | |
| 18 | |
| 19 @config_ctx() | |
| 20 def main_pool(c): | |
| 21 SetDevicePoolConfigs(c, 'main_pool') | |
| 22 | |
| 23 @config_ctx() | |
| 24 def commit_queue_pool(c): | |
| 25 SetDevicePoolConfigs(c, 'commit_queue_pool') | |
| 26 | |
| 27 @config_ctx() | |
| 28 def webview_pool(c): # pragma: no cover | |
| 29 SetDevicePoolConfigs(c, 'webview_pool') | |
| 30 | |
| 31 @config_ctx() | |
| 32 def low_end_pool(c): # pragma: no cover | |
| 33 SetDevicePoolConfigs(c, 'low_end_pool') | |
| 34 | |
| 35 def SetDevicePoolConfigs(c, pool_name): | |
| 36 c.pool = pool_name | |
| 37 c.api_key_file_url = '%s/%s/%s' % (GS_BASE_URL, pool_name, 'api_key') | |
| 38 c.api_secret_file_url = '%s/%s/%s' % (GS_BASE_URL, pool_name, 'api_secret') | |
| OLD | NEW |