removed syslog in favor of common module logging functions

This commit is contained in:
Brian Coca 2015-10-01 00:12:54 -04:00 committed by Matt Clay
parent 682cb99d45
commit d55ba3ab7c
6 changed files with 12 additions and 56 deletions

View file

@ -61,7 +61,6 @@ EXAMPLES = '''
- rpm_key: state=absent key=DEADB33F
'''
import re
import syslog
import os.path
import urllib2
import tempfile
@ -74,7 +73,6 @@ def is_pubkey(string):
class RpmKey:
def __init__(self, module):
self.syslogging = False
# If the key is a url, we need to check if it's present to be idempotent,
# to do that, we need to check the keyid, which we can get from the armor.
keyfile = None
@ -163,9 +161,6 @@ class RpmKey:
return re.match('(0x)?[0-9a-f]{8}', keystr, flags=re.IGNORECASE)
def execute_command(self, cmd):
if self.syslogging:
syslog.openlog('ansible-%s' % os.path.basename(__file__))
syslog.syslog(syslog.LOG_NOTICE, 'Command %s' % '|'.join(cmd))
rc, stdout, stderr = self.module.run_command(cmd)
if rc != 0:
self.module.fail_json(msg=stderr)