def findstr_in_file(file_path, line_str):
    """
    Return True if the line is in the file; False otherwise.
    (Trailing whitespace is ignored.)
    """
    try:
        with open(file_path, 'r') as fh:
            for line in fh.readlines():
                if line_str == line.rstrip():
                    return True
    except Exception:
        # swallow exception
        pass
    return False