def _find_rule_no(self, mac):
        """Find rule number associated with a given mac."""

        ipt_cmd = ['iptables', '-L', '--line-numbers']
        cmdo = dsl.execute(ipt_cmd, self._root_helper, log_output=False)
        for o in cmdo.split('\n'):
            if mac in o.lower():
                rule_no = o.split()[0]
                LOG.info(_LI('Found rule %(rule)s for %(mac)s.'),
                         {'rule': rule_no, 'mac': mac})
                return rule_no
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/apps/saf/agent/iptables_driver.py/IptablesDriver._find_rule_no/original