The operatingsystem fact on Fedora begins in a uppercase F

The error being thrown by this on Fedora was being silently ignored
added regex for this
Also adding adding a unit test for this
Adding the effected module to pep8 tests

Change-Id: I4e4d72e6de0bce597474434a4e18112f79913718
This commit is contained in:
Derek Higgins
2013-01-24 20:37:11 -05:00
parent 4fe5c01100
commit e49a1fb18b
5 changed files with 38 additions and 9 deletions

View File

@@ -102,8 +102,12 @@ def isErrorException(line):
return False
_re_errorline = re.compile('err: | Syntax error at|^Duplicate definition:|^Parameter name failed:')
_re_color = re.compile('\x1b.*?\d\dm')
_re_errorline = re.compile('err: | Syntax error at|^Duplicate definition:|'
'^Parameter name failed:|'
'^No matching value for selector param')
def validate_puppet_logfile(logfile):
"""
Check a puppet log file for errors and raise an error if we find any
@@ -115,7 +119,7 @@ def validate_puppet_logfile(logfile):
for line in data.split('\n'):
line = line.strip()
if _re_errorline.search(line) == None:
if _re_errorline.search(line) is None:
continue
message = _re_color.sub('', line) # remove colors