mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
parent
ebfd99e307
commit
e7d0c9f820
5 changed files with 33 additions and 35 deletions
|
@ -78,7 +78,6 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
_retries = FieldAttribute(isa='int', default=1)
|
||||
_run_once = FieldAttribute(isa='bool')
|
||||
_until = FieldAttribute(isa='list') # ?
|
||||
_vars = FieldAttribute(isa='dict', default=dict())
|
||||
|
||||
def __init__(self, block=None, role=None, task_include=None):
|
||||
''' constructors a task, without the Task.load classmethod, it will be pretty blank '''
|
||||
|
@ -166,9 +165,9 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
# be adding things to them below (special handling for includes).
|
||||
# When that deprecated feature is removed, this can be too.
|
||||
if 'vars' in ds:
|
||||
if not isinstance(ds['vars'], dict):
|
||||
raise AnsibleError("vars specified on a task must be a dictionary (got a %s)" % type(ds['vars']), obj=new_ds)
|
||||
new_ds['vars'] = ds.pop('vars')
|
||||
# _load_vars is defined in Base, and is used to load a dictionary
|
||||
# or list of dictionaries in a standard way
|
||||
new_ds['vars'] = self._load_vars(None, ds.pop('vars'))
|
||||
else:
|
||||
new_ds['vars'] = dict()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue