(table, chain, rule_d, ipv6=False)
return iptc_chain.rules.index(iptc_rule)
Return the position of a rule within a chain
Return the position of a rule within a chain
Return the position of a rule within a chain
def get_rule_position(table, chain, rule_d, ipv6=False):
    """ Return the position of a rule within a chain """
    if not has_rule(table, chain, rule_d):
        raise AttributeError('Chain <{}@{}> has no rule <{}>'.format(chain, table, rule_d))
    iptc_chain = _iptc_getchain(table, chain, ipv6)
    iptc_rule  = encode_iptc_rule(rule_d, ipv6)
    return iptc_chain.rules.index(iptc_rule)
def get_rule_position ( table , chain , rule_d , ipv6 = False ) : if not has_rule ( table , chain , rule_d ) : raise AttributeError ( 'Chain <{}@{}> has no rule <{}>' . format ( chain , table , rule_d ) ) iptc_chain = _iptc_getchain ( table , chain , ipv6 ) iptc_rule = encode_iptc_rule ( rule_d , ipv6 ) return iptc_chain . rules . index ( iptc_rule )