fixed typo in tree callback, added default dir

this would allow it to work with playbooks also
This commit is contained in:
Brian Coca 2015-12-08 11:59:04 -08:00
parent df04955572
commit 666cb07614

View file

@ -41,7 +41,8 @@ class CallbackModule(CallbackBase):
self.tree = TREE_DIR
if not self.tree:
self._display.warnings("Disabling tree callback, invalid directory provided to tree option: %s" % self.tree)
self.tree = os.path.expanduser("~/.ansible/tree")
self._display.warning("Defaulting to ~/.ansible/tree, invalid directory provided to tree option: %s" % self.tree)
def write_tree_file(self, hostname, buf):
''' write something into treedir/hostname '''
@ -53,7 +54,7 @@ class CallbackModule(CallbackBase):
with open(path, 'wb+') as fd:
fd.write(buf)
except (OSError, IOError) as e:
self._display.warnings("Unable to write to %s's file: %s" % (hostname, str(e)))
self._display.warning("Unable to write to %s's file: %s" % (hostname, str(e)))
def result_to_tree(self, result):
if self.tree: