<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_sentry(self, username):
 """ Returns contents of sentry file for the given username .. note:: returns ``None`` if :attr:`credential_location` is not set, or file is not found/inaccessible :param username: username :type username: :class:`str` :return: sentry file contents, or ``None`` :rtype: :class:`bytes`, :class:`None` """

        filepath = self._get_sentry_path(username)

        if filepath and os.path.isfile(filepath):
            try:
                with open(filepath, 'rb') as f:
                    return f.read()
            except IOError as e:
                self._LOG.error("get_sentry: %s" % str(e))

        return None