mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fixed typo in tree callback, added default dir
this would allow it to work with playbooks also
This commit is contained in:
parent
ec5827c22a
commit
795fac917e
1 changed files with 3 additions and 2 deletions
|
@ -41,7 +41,8 @@ class CallbackModule(CallbackBase):
|
||||||
|
|
||||||
self.tree = TREE_DIR
|
self.tree = TREE_DIR
|
||||||
if not self.tree:
|
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):
|
def write_tree_file(self, hostname, buf):
|
||||||
''' write something into treedir/hostname '''
|
''' write something into treedir/hostname '''
|
||||||
|
@ -53,7 +54,7 @@ class CallbackModule(CallbackBase):
|
||||||
with open(path, 'wb+') as fd:
|
with open(path, 'wb+') as fd:
|
||||||
fd.write(buf)
|
fd.write(buf)
|
||||||
except (OSError, IOError) as e:
|
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):
|
def result_to_tree(self, result):
|
||||||
if self.tree:
|
if self.tree:
|
||||||
|
|
Loading…
Reference in a new issue