'Return rule specified by rule_id.
@raise QosRuleNotFound: if there is no such rule in the policy.'

def get_rule_by_id(self, rule_id):

    for rule in self.rules:
        if (rule_id == rule.id):
            return rule
    raise exceptions.QosRuleNotFound(policy_id=self.id, rule_id=rule_id)
