add an ignorable error log and refined some code

This commit is contained in:
Nidylei 2016-02-19 09:59:11 +08:00
Родитель a8b33439cf
Коммит 11fff1f7db
2 изменённых файлов: 12 добавлений и 14 удалений

Просмотреть файл

@ -45,25 +45,22 @@ def RunTest():
def RemoveIgnorableMessages(messages, keywords):
matchstring = re.findall(keywords,messages,re.M)
matchcount = 0
index = 0
matchcount = 0
index = 0
if(matchstring):
for msg in matchstring:
RunLog.info('Ignorable ERROR message:\n' + msg)
matchcount +=1
matchcount += 1
while matchcount > 0:
matchcount -=1
str = re.split(matchstring[index],messages)
index+=1
messages=str[1]
matchcount -= 1
messages = messages.replace(matchstring[index],'')
index += 1
valid_list = []
for substr in str:
if re.search('error', substr, re.IGNORECASE):
valid_list.append(substr)
else:
continue
if re.search('error', messages, re.IGNORECASE):
valid_list.append(messages)
if len(valid_list) > 0:
return valid_list
else:

Просмотреть файл

@ -4,5 +4,6 @@
<keywords>.*Error Code is 127\n[^\n]*parted /dev/sdb print\n[^\n]*parted: command not found</keywords>
<keywords>.*Failed to config rdma device.*</keywords>
<keywords>.*ERROR:CalledProcessError. Error Code is 1\n[^\n]*ERROR:CalledProcessError. Command string was chcon unconfined_u:object_r:ssh_home_t:s0[^\n]*\n[^\n]*ERROR:CalledProcessError. Command result was chcon: invalid context: unconfined_u:object_r:ssh_home_t:s0: Operation not supported</keywords>
<keywords>.*NdDriverVersion not found.\n[^\n]*check or update Rdma driver failed with error[^\n]*\n[^\n]*\n[^\n]*\n[^\n]*\n[^\n]*\n[^\n]*RdmaError\n[^\n]*ERROR:</keywords>
</errors>
</messages>