mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-08 14:20:04 -07: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:
parent
036b779188
commit
aea022b002
17 changed files with 61 additions and 3 deletions
|
@ -27,6 +27,7 @@ import datetime
|
|||
import shlex
|
||||
import re
|
||||
import traceback
|
||||
import syslog
|
||||
|
||||
|
||||
try:
|
||||
|
@ -299,6 +300,8 @@ def main():
|
|||
|
||||
args = open(argfile, 'r').read()
|
||||
items = shlex.split(args)
|
||||
syslog.openlog('ansible-%s' % os.path.basename(__file__))
|
||||
syslog.syslog(syslog.LOG_NOTICE, 'Invoked with %s' % args)
|
||||
|
||||
if not len(items):
|
||||
msg = "the yum module requires arguments (-a)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue