Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
fe2f5065
Commit
fe2f5065
authored
Mar 24, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2462 from sfromm/issue2461
Make logging to journal match what goes to syslog on non-systemd hosts
parents
7f4718bc
cdb7f8ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
lib/ansible/module_common.py
+13
-9
No files found.
lib/ansible/module_common.py
View file @
fe2f5065
...
@@ -664,20 +664,24 @@ class AnsibleModule(object):
...
@@ -664,20 +664,24 @@ class AnsibleModule(object):
else:
else:
log_args[param] = self.params[param]
log_args[param] = self.params[param]
module = 'ansible-
%
s'
%
os.path.basename(__file__)
msg = ''
for arg in log_args:
msg = msg + arg + '=' + str(log_args[arg]) + ' '
if msg:
msg = 'Invoked with
%
s'
%
msg
else:
msg = 'Invoked'
if (has_journal):
if (has_journal):
journal_args = ["MESSAGE=Ansible module invoked", "MODULE=
%
s"
%
os.path.basename(__file__)]
journal_args = ["MESSAGE=
%
s
%
s"
%
(module, msg)]
journal_args.append("MODULE=
%
s"
%
os.path.basename(__file__))
for arg in log_args:
for arg in log_args:
journal_args.append(arg.upper() + "=" + str(log_args[arg]))
journal_args.append(arg.upper() + "=" + str(log_args[arg]))
journal.sendv(*journal_args)
journal.sendv(*journal_args)
else:
else:
msg = ''
syslog.openlog(module, 0, syslog.LOG_USER)
syslog.openlog('ansible-
%
s'
%
str(os.path.basename(__file__)), 0, syslog.LOG_USER)
syslog.syslog(syslog.LOG_NOTICE, msg)
for arg in log_args:
msg = msg + arg + '=' + str(log_args[arg]) + ' '
if msg:
syslog.syslog(syslog.LOG_NOTICE, 'Invoked with
%
s'
%
msg)
else:
syslog.syslog(syslog.LOG_NOTICE, 'Invoked')
def get_bin_path(self, arg, required=False, opt_dirs=[]):
def get_bin_path(self, arg, required=False, opt_dirs=[]):
'''
'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment