diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-23 19:37:16 +0800 |
---|---|---|
committer | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-24 08:53:40 +0800 |
commit | 48d36caabb09f2456a1d7ad64acb7aa099277eda (patch) | |
tree | 748c4bd2a5d4c3e2f6fc76a77b358f8174d598ab /qtip/ansible_library | |
parent | e579659699b4571a69990efc5861914e4701a4f6 (diff) |
Save logs before collecting
Change-Id: I0e39103ef917fa7ea86d5c47de0cc71c37fca74c
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'qtip/ansible_library')
-rw-r--r-- | qtip/ansible_library/plugins/action/collect.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/qtip/ansible_library/plugins/action/collect.py b/qtip/ansible_library/plugins/action/collect.py index f6ae7a5c..88ad0e35 100644 --- a/qtip/ansible_library/plugins/action/collect.py +++ b/qtip/ansible_library/plugins/action/collect.py @@ -10,7 +10,6 @@ ############################################################################## from collections import defaultdict -import os import re from ansible.plugins.action import ActionBase @@ -27,12 +26,6 @@ class ActionModule(ActionBase): string = self._task.args.get('string') patterns = self._task.args.get('patterns') - dump = self._task.args.get('dump') - if dump is not None: - root = task_vars.get('qtip_results', 'results') - base = task_vars.get('dump_base', 'dump') - dump_facts([{'name': dump, 'content': string}], root, base) - return collect(patterns, string) @@ -50,11 +43,3 @@ def collect(patterns, string): captured[key].append(value) return captured - - -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'])} - for fact in facts] |