Changeset - 9675fdbf66e7
[Not reviewed]
default
0 1 0
Branko Majic (branko) - 11 years ago 2013-07-25 20:09:30
branko@majic.rs
Noticket: Removed unused/useless template tag.
1 file changed with 0 insertions and 20 deletions:
0 comments (0 inline, 0 general)
conntrackt/templatetags/conntrackt_tags.py
Show inline comments
 
@@ -52,26 +52,6 @@ def html_link(text, view, *args, **kwarg
 
    return context
 

	
 

	
 
@register.simple_tag
 
def iptables(communication):
 
    """
 
    Produces an iptables rule based on the provided models.Communication object
 
    instance. The rule is appropriate for inclusion in the INPUT section of a
 
    file provided to the iptables-restore command.
 

	
 
    Arguments:
 

	
 
        communication - Instance of a models.Communication object.
 
    """
 
    values = (communication.source.address, communication.source.netmask, communication.protocol.lower(), communication.protocol.lower(), communication.port)
 
    if communication.protocol in ('TCP', 'UDP'):
 
        rule_template = "-A INPUT -s %s/%s -p %s -m %s --dport %s -j ACCEPT"
 
    elif communication.protocol in ('ICMP'):
 
        rule_template = "-A INPUT -s %s/%s -p %s -m %s --icmp-type %s -j ACCEPT"
 

	
 
    return rule_template % values
 

	
 

	
 
@register.simple_tag(takes_context=True)
 
def active_link(context, url_name, return_value='active', **kwargs):
 
    """
0 comments (0 inline, 0 general)