Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2819)

Unified Diff: recipes.py

Issue 1421843006: Add simple depends_on API. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Respond to comments. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipes.py
diff --git a/recipes.py b/recipes.py
index d243cc268aad05b7704b69290c48c57a78aac018..40f69bd842f53d36648a69bc278e79732c3d4d3f 100755
--- a/recipes.py
+++ b/recipes.py
@@ -31,7 +31,12 @@ def get_package_config(args):
def simulation_test(package_deps, args):
from recipe_engine import simulation_test
- simulation_test.main(package_deps, args=json.loads(args.args))
+ from recipe_engine import loader
+
+ _, config_file = get_package_config(args)
+ universe = loader.RecipeUniverse(package_deps, config_file.path)
+
+ simulation_test.main(universe, args=json.loads(args.args))
def lint(package_deps, args):
@@ -108,7 +113,8 @@ def run(package_deps, args):
os.environ['PYTHONUNBUFFERED'] = '1'
os.environ['PYTHONIOENCODING'] = 'UTF-8'
- universe = loader.RecipeUniverse(package_deps)
+ _, config_file = get_package_config(args)
+ universe = loader.RecipeUniverse(package_deps, config_file.path)
workdir = (args.workdir or
os.path.join(os.path.dirname(os.path.realpath(__file__)), 'workdir'))
@@ -126,7 +132,7 @@ def run(package_deps, args):
finally:
os.chdir(old_cwd)
- return handle_recipe_return(ret, args.result_file, stream)
+ return handle_recipe_return(ret, args.output_result_json, stream)
def roll(args):
@@ -263,7 +269,7 @@ def main():
'--workdir',
help='The working directory of recipe execution')
run_p.add_argument(
- '--result-file',
+ '--output-result-json',
help='The file to write the JSON serialized returned value \
of the recipe to')
run_p.add_argument(

Powered by Google App Engine
This is Rietveld 408576698