basic: Skip over module parameters (#74559)
While logging, journal.send accepts module parameters. If module parameters similar to arguments in journal.send, rename the parameter names before sending to journal.send Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
2c93b22043
commit
1006363589
2 changed files with 12 additions and 1 deletions
2
changelogs/fragments/71343_yum_repository.yml
Normal file
2
changelogs/fragments/71343_yum_repository.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- basic - skip over module parameters which are used in ``journal.send`` API call (https://github.com/ansible/ansible/issues/71343).
|
|
@ -1338,7 +1338,16 @@ class AnsibleModule(object):
|
|||
if has_journal:
|
||||
journal_args = [("MODULE", os.path.basename(__file__))]
|
||||
for arg in log_args:
|
||||
journal_args.append((arg.upper(), str(log_args[arg])))
|
||||
name, value = (arg.upper(), str(log_args[arg]))
|
||||
if name in (
|
||||
'PRIORITY', 'MESSAGE', 'MESSAGE_ID',
|
||||
'CODE_FILE', 'CODE_LINE', 'CODE_FUNC',
|
||||
'SYSLOG_FACILITY', 'SYSLOG_IDENTIFIER',
|
||||
'SYSLOG_PID',
|
||||
):
|
||||
name = "_%s" % name
|
||||
journal_args.append((name, value))
|
||||
|
||||
try:
|
||||
if HAS_SYSLOG:
|
||||
# If syslog_facility specified, it needs to convert
|
||||
|
|
Loading…
Reference in a new issue