'Remove a rule from a chain.
Note: The rule must be exactly identical to the one that was added.
You cannot switch arguments around like you can with the iptables
CLI tool.'

def remove_rule(self, chain, rule, wrap=True, top=False, comment=None):

    chain = get_chain_name(chain, wrap)
    try:
        if ('$' in rule):
            rule = '    '.join((self._wrap_target_chain(e, wrap) for e in rule.split('    ')))
        self.rules.remove(IptablesRule(chain, rule, wrap, top, self.wrap_name, comment=comment))
        if (not wrap):
            self.remove_rules.append(str(IptablesRule(chain, rule, wrap, top, self.wrap_name, comment=comment)))
    except ValueError:
        LOG.warning(_LW('Tried    to    remove    rule    that    was    not    there:    %(chain)r    %(rule)r    %(wrap)r    %(top)r'), {'chain': chain, 'rule': rule, 'top': top, 'wrap': wrap})
