'Update metering lable rules based on namespace.'

def _update_metering_label_rules_based_on_ns(self, router, ext_dev, im):

    with IptablesManagerTransaction(im):
        labels = router.get(constants.METERING_LABEL_KEY, [])
        for label in labels:
            label_id = label['id']
            label_chain = iptables_manager.get_chain_name(((WRAP_NAME + LABEL) + label_id), wrap=False)
            rules_chain = iptables_manager.get_chain_name(((WRAP_NAME + RULE) + label_id), wrap=False)
            im.ipv4['filter'].empty_chain(rules_chain, wrap=False)
            rules = label.get('rules')
            if rules:
                self._process_metering_label_rules(rules, label_chain, rules_chain, ext_dev, im)
