From c180dc40305d69db346d9e6369dd8dcd87076be8 Mon Sep 17 00:00:00 2001 From: Michael Achenbach Date: Fri, 21 Apr 2017 17:17:28 +0200 Subject: [PATCH] Remove directly accessing got_revision_mapping Bug: 713356 Change-Id: I2c5d92152b293ca553efc875f49c28fb0fc888ed Reviewed-on: https://chromium-review.googlesource.com/484460 Reviewed-by: Andrii Shyshkalov Commit-Queue: Michael Achenbach --- recipes/recipe_modules/gclient/api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/recipe_modules/gclient/api.py b/recipes/recipe_modules/gclient/api.py index cda984a46..9447305a3 100644 --- a/recipes/recipe_modules/gclient/api.py +++ b/recipes/recipe_modules/gclient/api.py @@ -166,7 +166,7 @@ class GclientApi(recipe_api.RecipeApi): if fixed_revision: revisions.extend(['--revision', '%s@%s' % (name, fixed_revision)]) - test_data_paths = set(cfg.got_revision_mapping.keys() + + test_data_paths = set(self.got_revision_reverse_mapping(cfg).values() + [s.name for s in cfg.solutions]) step_test_data = lambda: ( self.test_api.output_json(test_data_paths)) @@ -195,12 +195,12 @@ class GclientApi(recipe_api.RecipeApi): **kwargs) finally: result = self.m.step.active_result - data = result.json.output - for path, info in data['solutions'].iteritems(): + solutions = result.json.output['solutions'] + for propname, path in sorted( + self.got_revision_reverse_mapping(cfg).iteritems()): # gclient json paths always end with a slash - path = path.rstrip('/') - if path in cfg.got_revision_mapping: - propname = cfg.got_revision_mapping[path] + info = solutions.get(path + '/') or solutions.get(path) + if info: result.presentation.properties[propname] = info['revision'] return result