fixed typo in tree callback, added default dir

this would allow it to work with playbooks also
pull/13132/head
Brian Coca 9 years ago
parent ec5827c22a
commit 795fac917e

@ -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:

Loading…
Cancel
Save