(table, chain, old_rule_d, new_rule_d, ipv6=False)
Replaces an existing rule of a chain
Replaces an existing rule of a chain
Replaces an existing rule of a chain
def replace_rule(table, chain, old_rule_d, new_rule_d, ipv6=False):
    """ Replaces an existing rule of a chain """
    iptc_chain = _iptc_getchain(table, chain, ipv6)
    iptc_old_rule = encode_iptc_rule(old_rule_d, ipv6)
    iptc_new_rule = encode_iptc_rule(new_rule_d, ipv6)
    iptc_chain.replace_rule(iptc_new_rule, iptc_chain.rules.index(iptc_old_rule))
def replace_rule ( table , chain , old_rule_d , new_rule_d , ipv6 = False ) : iptc_chain = _iptc_getchain ( table , chain , ipv6 ) iptc_old_rule = encode_iptc_rule ( old_rule_d , ipv6 ) iptc_new_rule = encode_iptc_rule ( new_rule_d , ipv6 ) iptc_chain . replace_rule ( iptc_new_rule , iptc_chain . rules . index ( iptc_old_rule ) )