'Indicates whether the specified rule values are already
defined in the default security group rules.'

def default_rule_exists(self, context, values):

    for rule in self.db.security_group_default_rule_list(context):
        keys = ('cidr', 'from_port', 'to_port', 'protocol')
        for key in keys:
            if (rule.get(key) != values.get(key)):
                break
        else:
            return (rule.get('id') or True)
    return False
