sysloghander: check for 3.5.4 python version

This commit is contained in:
Ch3LL 2018-05-10 14:12:15 -04:00
parent a020352a03
commit 31f13a4197
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73
2 changed files with 2 additions and 3 deletions

View file

@ -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')

View file

@ -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)