Index: scripts/slave/recipe_modules/step/api.py |
diff --git a/scripts/slave/recipe_modules/step/api.py b/scripts/slave/recipe_modules/step/api.py |
index 4864e827538e65b7e72e48c88400eea221574bc1..b3c44557b553c4b8369eae50de41a7b747ab91d6 100644 |
--- a/scripts/slave/recipe_modules/step/api.py |
+++ b/scripts/slave/recipe_modules/step/api.py |
@@ -8,6 +8,10 @@ |
# Inherit from RecipeApiPlain because the only thing which is a step is |
# run_from_dict() |
class StepApi(recipe_api.RecipeApiPlain): |
+ def __init__(self, **kwargs): |
+ super(StepApi, self).__init__(**kwargs) |
+ self._step_names = {} |
+ |
EXCEPTION = 'EXCEPTION' |
FAILURE = 'FAILURE' |
SUCCESS = 'SUCCESS' |
@@ -91,6 +95,11 @@ |
command = list(wrapper) |
command += cmd |
+ step_count = self._step_names.setdefault(name, 0) + 1 |
+ self._step_names[name] = step_count |
+ if step_count > 1: |
+ name = "%s (%d)" % (name, step_count) |
+ |
kwargs.update({'name': name, 'cmd': command}) |
kwargs['ok_ret'] = ok_ret |
kwargs['infra_step'] = bool(infra_step) |