made display part of variable manager and corrected reference to it

fixes #12859
This commit is contained in:
Brian Coca 2015-10-21 22:28:55 -04:00
parent aac20aa076
commit 08c9e70307

View file

@ -49,13 +49,6 @@ from ansible.vars.unsafe_proxy import wrap_var
VARIABLE_CACHE = dict()
HOSTVARS_CACHE = dict()
try:
from __main__ import display
display = display
except ImportError:
from ansible.utils.display import Display
display = Display()
def preprocess_vars(a):
'''
Ensures that vars contained in the parameter passed in are
@ -89,6 +82,13 @@ class VariableManager:
self._inventory = None
self._omit_token = '__omit_place_holder__%s' % sha1(os.urandom(64)).hexdigest()
try:
from __main__ import display
self._display = display
except ImportError:
from ansible.utils.display import Display
self._display = Display()
def __getstate__(self):
data = dict(
fact_cache = self._fact_cache.copy(),
@ -291,7 +291,7 @@ class VariableManager:
else:
# we do not have a full context here, and the missing variable could be
# because of that, so just show a warning and continue
display.vvv("skipping vars_file '%s' due to an undefined variable" % vars_file_item)
self._display.vvv("skipping vars_file '%s' due to an undefined variable" % vars_file_item)
continue
if not C.DEFAULT_PRIVATE_ROLE_VARS: