<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def scan_file(self, filename, filename_key=None):
 """Scans a specified file, and adds information to self.data :type filename: str :param filename: full path to file to scan. :type filename_key: str :param filename_key: key to store in self.data :returns: boolean; though this value is only used for testing """


        if not filename_key:
            filename_key = filename

        if os.path.islink(filename):
            return False

        try:
            with codecs.open(filename, encoding='utf-8') as f:
                self._extract_secrets_from_file(f, filename_key)

            return True
        except IOError:
            log.warning("Unable to open file: %s", filename)
            return False