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

Unified Diff: recipe_engine/step_runner.py

Issue 2925453002: [context] Add path prefix/suffix manipulation. (Closed)
Patch Set: advise Created 3 years, 6 months 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
« no previous file with comments | « no previous file | recipe_modules/context/api.py » ('j') | recipe_modules/context/api.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/step_runner.py
diff --git a/recipe_engine/step_runner.py b/recipe_engine/step_runner.py
index f0e02fa698e64b7c01c358a972018fd17456e5cf..421072e31e9884a3867486abd3e55116fb6b6e4e 100644
--- a/recipe_engine/step_runner.py
+++ b/recipe_engine/step_runner.py
@@ -425,6 +425,9 @@ class fakeEnviron(object):
def __getitem__(self, key):
return '<%s>' % key
+ def keys(self):
+ return self.data.keys()
+
def __delitem__(self, key):
self.data[key] = None
@@ -695,6 +698,8 @@ def _merge_envs(original, override):
opposed to overwriting, variables like PATH).
"""
result = original.copy()
+ subst = (original if isinstance(original, fakeEnviron)
+ else collections.defaultdict(lambda: '', **original))
if not override:
return result
for k, v in override.items():
@@ -702,7 +707,7 @@ def _merge_envs(original, override):
if k in result:
del result[k]
else:
- result[str(k)] = str(v) % original
+ result[str(k)] = str(v) % subst
dnj 2017/06/03 15:37:33 This fixes a bug where an environment variable tha
iannucci 2017/06/05 19:23:04 Yeah, and with this CL I'd like to eventually elim
dnj 2017/06/07 02:59:28 ACK, but I think for now we still need it for back
return result
« no previous file with comments | « no previous file | recipe_modules/context/api.py » ('j') | recipe_modules/context/api.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698