'Implements RbacNeutronObject.get_bound_tenant_ids.
:returns: set -- a set of tenants\' ids dependant on QosPolicy.'

@classmethod
def get_bound_tenant_ids(cls, context, policy_id):

    net = models_v2.Network
    qosnet = qos_db_model.QosNetworkPolicyBinding
    port = models_v2.Port
    qosport = qos_db_model.QosPortPolicyBinding
    bound_tenants = []
    with db_api.autonested_transaction(context.session):
        bound_tenants.extend(cls._get_bound_tenant_ids(context.session, qosnet, net, qosnet.network_id, policy_id))
        bound_tenants.extend(cls._get_bound_tenant_ids(context.session, qosport, port, qosport.port_id, policy_id))
    return set(bound_tenants)
