def check_filter_validity(self, reply, filter_str):
try:<EOL><INDENT>f_ind = reply.index(filter_str)<EOL>l_ind = reply.rindex(filter_str)<EOL><DEDENT>except Exception:<EOL><INDENT>fail_reason = vdp_const.filter_failure_reason % (reply)<EOL>LOG.error("<STR_LIT:%s>", fail_reason)<EOL>return False, fail_reason<EOL><DEDENT>if f_ind != l_ind:<EOL><INDENT>fail_reason = vdp_const.multiple_filter_failure_reason % (reply)<EOL>LOG.error("<STR_LIT:%s>", fail_reason)<EOL>return False, fail_reason<EOL><DEDENT>return True, None<EOL>
Check for the validify of the filter.