Need you help. "matcherror" is a list and contains list of error codes which it needs to match with "errormsg". I want to match "Agent is not authorized to under pay on a booking" with the full error message mentioned in the "errormsg" and ignore the other parameters (i.e ignore Total Cost = 10812.00000, Total Payment = 10308". In-fact whatever i mention in the "matcherror" should match with the "errormsg" and ignore rest of the sentence.
matcherror = ["['Connection Refused']","['Link Down']","['Agent is not authorized to under pay on a booking.']"]
errormsg = "Agent is not authorized to under pay on a booking. Total Cost = 10812.00000, Total Payment = 10308"
Bacially i am trying to achieve something like:
matcherror = ["['Connection Refused']","['Link Down']","['Agent is not authorized to under pay on a booking.']"]
errormsg = "Agent is not authorized to under pay on a booking. Total Cost = 10812.00000, Total Payment = 10308"
evaluate = matcherror in errormsg
if evaluate == True:
send_email(showfailure)
else:
print "No failure for this hour"