Skip to content

Commit

Permalink
Merge branch 'master' into mgirgis-OSPRH-8378
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiesmelfie authored Sep 12, 2024
2 parents 84232f6 + 2743f6c commit 48aeef6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 14 additions & 2 deletions callback_plugins/custom_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
- Log file names:
- test_run_result.out
- summary_results.log
options:
output_dir:
description: todo
ini:
- section: custom_logger
key: output_dir
env:
- name: CUSTOM_LOGGER_OUTPUT_DIR
default: "."
type: path
'''

class CallbackModule(CallbackBase):
Expand All @@ -31,9 +41,11 @@ class CallbackModule(CallbackBase):

def __init__(self):
super(CallbackModule, self).__init__()
self.output_dir = os.path.expanduser("~/")
self.results = {}
self.set_options()

self.output_dir = self.get_option('output_dir')
self.results = {}

def playbook_on_stats(self, stats):
#Log results for each host
hosts= stats.processed
Expand Down
3 changes: 3 additions & 0 deletions ci/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ callback_plugins = ../callback_plugins
roles_path = ../roles:/usr/share/ansible/roles:/etc/ansible/roles:~/.ansible/roles:../../ci-framework/roles

verbosity = 3

[custom_logger]
output_dir = /$HOME

0 comments on commit 48aeef6

Please sign in to comment.