Add netns support check

Change-Id: I03d0a6bebaeddddcbcf49c376ff1c9d03ff1bdec
Fixes: rhbz#966560
This commit is contained in:
Martin Magr
2013-05-24 13:21:02 +02:00
parent 77b481a44c
commit 1cd4ec913d
12 changed files with 320 additions and 13 deletions

View File

@@ -143,3 +143,20 @@ def validate_puppet_logfile(logfile):
logging.error("Error during remote puppet apply of " + manifestfile)
logging.error(data)
raise PackStackError(message)
def scan_puppet_logfile(logfile):
"""
Returns list of packstack_info/packstack_warn notices parsed from
given puppet log file.
"""
output = []
notice = re.compile(r"notice: .*Notify\[packstack_info\]"
"\/message: defined \'message\' as "
"\'(?P<message>.*)\'")
with open(logfile) as content:
for line in content:
match = notice.search(line)
if match:
output.append(match.group('message'))
return output