<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_license(self):
 """Checks if license_file' is configured and adds it to 'self.filelist' if the value contains a valid path. """


        opts = self.distribution.get_option_dict('metadata')

        # ignore the source of the value
        _, license_file = opts.get('license_file', (None, None))

        if license_file is None:
            log.debug("'license_file' option was not specified")
            return

        if not os.path.exists(license_file):
            log.warn("warning: Failed to find the configured license file '%s'",
                    license_file)
            return

        self.filelist.append(license_file)