summaryrefslogtreecommitdiffstats
path: root/qtip
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-20 22:51:59 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-21 13:43:50 +0800
commit6144eac326d14e26bbb849abea51c4cf7f3881b6 (patch)
tree15ab6fcd3eadfb6d9ae7d089b237a2f0416a9235 /qtip
parent7273ca98a91399e188af15e192be93724977fe08 (diff)
Group test results and report under node
Change-Id: I66286787d06c5012c6dcf516cffb9f6fd76522c5 Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'qtip')
-rw-r--r--qtip/ansible_library/plugins/action/collect.py6
1 files changed, 3 insertions, 3 deletions
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'])}