| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from recipe_engine import recipe_api | 5 from recipe_engine import recipe_api |
| 6 | 6 |
| 7 import base64 | 7 import base64 |
| 8 import json | 8 import json |
| 9 | 9 |
| 10 class LuciConfigApi(recipe_api.RecipeApi): | 10 class LuciConfigApi(recipe_api.RecipeApi): |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 url = self.c.base_url + '/_ah/api/config/v1/config_sets/' | 64 url = self.c.base_url + '/_ah/api/config/v1/config_sets/' |
| 65 url += self.m.url.quote('projects/%s/refs/heads/master' % project, safe='') | 65 url += self.m.url.quote('projects/%s/refs/heads/master' % project, safe='') |
| 66 url += '/config/%s' % config | 66 url += '/config/%s' % config |
| 67 | 67 |
| 68 fetch_result = self._fetch( | 68 fetch_result = self._fetch( |
| 69 url, step_name='Get project %r config %r' % (project, config), | 69 url, step_name='Get project %r config %r' % (project, config), |
| 70 headers=self._get_headers()) | 70 headers=self._get_headers()) |
| 71 result = json.loads(fetch_result) | 71 result = json.loads(fetch_result) |
| 72 result['content'] = base64.b64decode(result['content']) | 72 result['content'] = base64.b64decode(result['content']) |
| 73 return result | 73 return result |
| 74 |
| 75 def get_project_metadata(self, project): |
| 76 mapping = self.get_projects() |
| 77 return mapping.get(project) |
| 78 |
| OLD | NEW |