def find_match(self):
self.load()<EOL>for yamldoc in self.yamldocs:<EOL><INDENT>self.logdebug('<STR_LIT>' % yamldoc)<EOL>if not yamldoc:<EOL><INDENT>continue<EOL><DEDENT>if not self.check_client_ip(yamldoc):<EOL><INDENT>continue<EOL><DEDENT>if not self.check_keyname(yamldoc):<EOL><INDENT>continue<EOL><DEDENT>rules = yamldoc.get('<STR_LIT>')<EOL>if not isinstance(rules, list):<EOL><INDENT>rules = [rules]<EOL><DEDENT>for rule in rules:<EOL><INDENT>rule_type = rule.get('<STR_LIT>', '<STR_LIT>')<EOL>if rule_type == '<STR_LIT>':<EOL><INDENT>sub = self.find_match_command<EOL><DEDENT>elif rule_type == '<STR_LIT>':<EOL><INDENT>sub = self.find_match_scp<EOL><DEDENT>else:<EOL><INDENT>self.log('<STR_LIT>' % rule_type)<EOL>self.raise_and_log_error(ConfigError,<EOL>'<STR_LIT>')<EOL><DEDENT>match = sub(rule)<EOL>if match:<EOL><INDENT>return match<EOL><DEDENT><DEDENT><DEDENT>raise CommandRejected('<STR_LIT>' %<EOL>self.original_command_string)<EOL>
Load the config and find a matching rule.

        returns the results of find_match_command, a dict of
        the command and (in the future) other metadata.