mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
switched to use module loggigng
This commit is contained in:
parent
a04972c79b
commit
ae84177514
5 changed files with 16 additions and 48 deletions
|
@ -124,8 +124,6 @@ class CronVar(object):
|
|||
self.user = 'root'
|
||||
self.lines = None
|
||||
self.wordchars = ''.join(chr(x) for x in range(128) if chr(x) not in ('=', "'", '"', ))
|
||||
# select whether we dump additional debug info through syslog
|
||||
self.syslogging = False
|
||||
|
||||
if cron_file:
|
||||
self.cron_file = '/etc/cron.d/%s' % cron_file
|
||||
|
@ -165,8 +163,7 @@ class CronVar(object):
|
|||
count += 1
|
||||
|
||||
def log_message(self, message):
|
||||
if self.syslogging:
|
||||
syslog.syslog(syslog.LOG_NOTICE, 'ansible: "%s"' % message)
|
||||
self.module.debug('ansible: "%s"' % message)
|
||||
|
||||
def write(self, backup_file=None):
|
||||
"""
|
||||
|
@ -363,9 +360,7 @@ def main():
|
|||
os.umask(022)
|
||||
cronvar = CronVar(module, user, cron_file)
|
||||
|
||||
if cronvar.syslogging:
|
||||
syslog.openlog('ansible-%s' % os.path.basename(__file__))
|
||||
syslog.syslog(syslog.LOG_NOTICE, 'cronvar instantiated - name: "%s"' % name)
|
||||
module.debug('cronvar instantiated - name: "%s"' % name)
|
||||
|
||||
# --- user input validation ---
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue