def check_client_ip(self, rule):
if not rule.get('<STR_LIT>'):<EOL><INDENT>self.logdebug('<STR_LIT>')<EOL>return True<EOL><DEDENT>allow_from = rule.get('<STR_LIT>')<EOL>if not isinstance(allow_from, list):<EOL><INDENT>allow_from = [allow_from]<EOL><DEDENT>client_ip = self.get_client_ip()<EOL>if client_ip in allow_from:<EOL><INDENT>self.logdebug('<STR_LIT>' % (client_ip, allow_from))<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>self.logdebug('<STR_LIT>' % (client_ip, allow_from))<EOL>return False<EOL><DEDENT>
If a client IP is specified, verify it is permitted.