mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Apply logging of arguments to modules (issue #122)
The ohai and facter modules use /usr/bin/logger to log the fact that
they have been invoked. I added 'import os' to the ping module
so that it could have the same syslog statements as the other modules.
I separated the condensed:
shlex.split(open(argfile, 'r').read())
into two separate statements similar to the other modules.
This commit is contained in:
@@ -31,6 +31,7 @@ import socket
|
||||
import struct
|
||||
import subprocess
|
||||
import traceback
|
||||
import syslog
|
||||
|
||||
try:
|
||||
import json
|
||||
@@ -295,6 +296,9 @@ except:
|
||||
(k,v) = opt.split("=")
|
||||
setup_options[k]=v
|
||||
|
||||
syslog.openlog('ansible-%s' % os.path.basename(__file__))
|
||||
syslog.syslog(syslog.LOG_NOTICE, 'Invoked with %s' % setup_options)
|
||||
|
||||
ansible_file = os.path.expandvars(setup_options.get('metadata', DEFAULT_ANSIBLE_SETUP))
|
||||
ansible_dir = os.path.dirname(ansible_file)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user