mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 06:30:19 -07:00
removed syslog in favor of common module logging functions
This commit is contained in:
parent
682cb99d45
commit
d55ba3ab7c
6 changed files with 12 additions and 56 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue