def build_acl(self, tenant_name, rule):
<EOL>if rule['<STR_LIT:action>'] == '<STR_LIT>':<EOL><INDENT>action = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>action = '<STR_LIT>'<EOL><DEDENT>acl_str = "<STR_LIT>"<EOL>acl = acl_str % {'<STR_LIT>': tenant_name, '<STR_LIT:action>': action,<EOL>'<STR_LIT>': rule.get('<STR_LIT>')}<EOL>src_ip = self.get_ip_address(rule.get('<STR_LIT>'))<EOL>ip_acl = self.build_acl_ip(src_ip)<EOL>acl += ip_acl<EOL>acl += self.build_acl_port(rule.get('<STR_LIT>'))<EOL>dst_ip = self.get_ip_address(rule.get('<STR_LIT>'))<EOL>ip_acl = self.build_acl_ip(dst_ip)<EOL>acl += ip_acl<EOL>acl += self.build_acl_port(rule.get('<STR_LIT>'),<EOL>enabled=rule.get('<STR_LIT>'))<EOL>return acl<EOL>
Build the ACL.