mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
switched to use module loggigng
This commit is contained in:
@@ -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 ---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user