mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
sysloghander: check for 3.5.4 python version
This commit is contained in:
parent
a020352a03
commit
31f13a4197
2 changed files with 2 additions and 3 deletions
|
@ -17,7 +17,6 @@ import logging.handlers
|
|||
|
||||
# Import salt libs
|
||||
from salt.log.mixins import NewStyleClassMixIn, ExcInfoOnLogLevelFormatMixIn
|
||||
from salt.ext import six
|
||||
from salt.ext.six.moves import queue
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -110,7 +109,7 @@ class SysLogHandler(ExcInfoOnLogLevelFormatMixIn, logging.handlers.SysLogHandler
|
|||
Deal with syslog os errors when the log file does not exist
|
||||
'''
|
||||
handled = False
|
||||
if sys.stderr and six.PY3:
|
||||
if sys.stderr and sys.version_info >= (3, 5, 4):
|
||||
t, v, tb = sys.exc_info()
|
||||
if t.__name__ in 'FileNotFoundError':
|
||||
sys.stderr.write('[WARNING ] The log_file does not exist. Logging not setup correctly or syslog service not started.\n')
|
||||
|
|
|
@ -368,7 +368,7 @@ class CallTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMixin
|
|||
with_retcode=True
|
||||
)
|
||||
try:
|
||||
if six.PY3:
|
||||
if sys.version_info >= (3, 5, 4):
|
||||
self.assertIn('local:', ret[0])
|
||||
self.assertIn('[WARNING ] The log_file does not exist. Logging not setup correctly or syslog service not started.', ret[1])
|
||||
self.assertEqual(ret[2], 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue