From 6144eac326d14e26bbb849abea51c4cf7f3881b6 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Thu, 20 Apr 2017 22:51:59 +0800 Subject: Group test results and report under node Change-Id: I66286787d06c5012c6dcf516cffb9f6fd76522c5 Signed-off-by: Yujun Zhang --- qtip/ansible_library/plugins/action/collect.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qtip') diff --git a/qtip/ansible_library/plugins/action/collect.py b/qtip/ansible_library/plugins/action/collect.py index 8c825317..17439710 100644 --- a/qtip/ansible_library/plugins/action/collect.py +++ b/qtip/ansible_library/plugins/action/collect.py @@ -29,7 +29,7 @@ class ActionModule(ActionBase): dump = self._task.args.get('dump') if dump is not None: - dump_facts(task_vars['inventory_hostname'], [{'name': dump, 'content': string}]) + dump_facts(task_vars['inventory_hostname'], [{'name': dump, 'content': string}], task_vars['qtip_results']) return collect(patterns, string) @@ -50,8 +50,8 @@ def collect(patterns, string): return captured -def dump_facts(hostname, facts): - dump_root = os.path.join('dump', hostname) +def dump_facts(hostname, facts, root='results'): + dump_root = os.path.join(root, hostname) if not os.path.exists(dump_root): os.mkdir(dump_root) return [{'name': fact['name'], 'result': open(os.path.join(dump_root, fact['name']), 'w+').write(fact['content'])} -- cgit 1.2.3-korg