From a6f6a80caa059c0a104277640168c059a51976a4 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 30 Nov 2015 15:08:07 -0800 Subject: [PATCH] avoid inheritance issues with default=dict declaration at class level this should avoid the issue of subsequent plays not prompting for a var prompted for in a previous play. --- lib/ansible/playbook/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/base.py b/lib/ansible/playbook/base.py index 58cfec00784..914bdb4d911 100644 --- a/lib/ansible/playbook/base.py +++ b/lib/ansible/playbook/base.py @@ -49,7 +49,7 @@ class Base: _remote_user = FieldAttribute(isa='string') # variables - _vars = FieldAttribute(isa='dict', default=dict(), priority=100) + _vars = FieldAttribute(isa='dict', priority=100) # flags and misc. settings _environment = FieldAttribute(isa='list') @@ -77,6 +77,9 @@ class Base: # and initialize the base attributes self._initialize_base_attributes() + if self.vars is None: + self.vars = dict() + # The following three functions are used to programatically define data # descriptors (aka properties) for the Attributes of all of the playbook # objects (tasks, blocks, plays, etc).