mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Ensure environment is inherited properly (task->block/include->play)
This commit is contained in:
parent
937584cd52
commit
76ae577519
3 changed files with 7 additions and 6 deletions
|
@ -442,7 +442,7 @@ class Base:
|
||||||
new_value = [ new_value ]
|
new_value = [ new_value ]
|
||||||
|
|
||||||
#return list(set(value + new_value))
|
#return list(set(value + new_value))
|
||||||
return [i for i,_ in itertools.groupby(value + new_value)]
|
return [i for i,_ in itertools.groupby(value + new_value) if i is not None]
|
||||||
|
|
||||||
def __getstate__(self):
|
def __getstate__(self):
|
||||||
return self.serialize()
|
return self.serialize()
|
||||||
|
|
|
@ -323,8 +323,9 @@ class Block(Base, Become, Conditional, Taggable):
|
||||||
Override for the 'tags' getattr fetcher, used from Base.
|
Override for the 'tags' getattr fetcher, used from Base.
|
||||||
'''
|
'''
|
||||||
environment = self._attributes['environment']
|
environment = self._attributes['environment']
|
||||||
if environment is None:
|
parent_environment = self._get_parent_attribute('environment', extend=True)
|
||||||
environment = self._get_parent_attribute('environment', extend=True)
|
if parent_environment is not None:
|
||||||
|
environment = self._extend_value(environment, parent_environment)
|
||||||
|
|
||||||
return environment
|
return environment
|
||||||
|
|
||||||
|
|
|
@ -383,8 +383,8 @@ class Task(Base, Conditional, Taggable, Become):
|
||||||
Override for the 'tags' getattr fetcher, used from Base.
|
Override for the 'tags' getattr fetcher, used from Base.
|
||||||
'''
|
'''
|
||||||
environment = self._attributes['environment']
|
environment = self._attributes['environment']
|
||||||
if environment is None:
|
parent_environment = self._get_parent_attribute('environment', extend=True)
|
||||||
environment = self._get_parent_attribute('environment')
|
if parent_environment is not None:
|
||||||
|
environment = self._extend_value(environment, parent_environment)
|
||||||
return environment
|
return environment
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue