From 385aa6e98428982802ea14a4f6a5a32d3f78c643 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Sat, 22 Apr 2017 10:29:12 +0800 Subject: Organize results in folder named with pod and current date Change-Id: I0882fb4548c3c3a6a72c6f752f8074e553ee3748 Signed-off-by: Yujun Zhang --- qtip/ansible_library/plugins/action/collect.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qtip/ansible_library/plugins/action/collect.py') diff --git a/qtip/ansible_library/plugins/action/collect.py b/qtip/ansible_library/plugins/action/collect.py index 0ae3477d..f6ae7a5c 100644 --- a/qtip/ansible_library/plugins/action/collect.py +++ b/qtip/ansible_library/plugins/action/collect.py @@ -31,7 +31,7 @@ class ActionModule(ActionBase): if dump is not None: root = task_vars.get('qtip_results', 'results') base = task_vars.get('dump_base', 'dump') - dump_facts(task_vars['inventory_hostname'], [{'name': dump, 'content': string}], root, base) + dump_facts([{'name': dump, 'content': string}], root, base) return collect(patterns, string) @@ -52,8 +52,8 @@ def collect(patterns, string): return captured -def dump_facts(hostname, facts, root, base): - dest = os.path.join(root, hostname, base) +def dump_facts(facts, root, base): + dest = os.path.join(root, base) if not os.path.exists(dest): os.makedirs(dest) return [{'name': fact['name'], 'result': open(os.path.join(dest, fact['name']), 'w+').write(fact['content'])} -- cgit 1.2.3-korg