Fix using loops with environment and add tests (#32796)

This commit is contained in:
Sloane Hertel 2017-12-08 10:13:22 -05:00 committed by GitHub
commit 7bb35e8781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 93 additions and 4 deletions

View file

@ -180,10 +180,9 @@ class ActionBase(with_metaclass(ABCMeta, object)):
if not isinstance(environments, list):
environments = [environments]
# the environments as inherited need to be reversed, to make
# sure we merge in the parent's values first so those in the
# block then task 'win' in precedence
environments.reverse()
# The order of environments matters to make sure we merge
# in the parent's values first so those in the block then
# task 'win' in precedence
for environment in environments:
if environment is None or len(environment) == 0:
continue