def convert_pipedata(pipe_data):
    """
    converts the pipe data from bots:queues kvs to
    src_queues: bots kv, #dst_queues: count kvs
    """
    sqs2bot = {}
    dsq_count = {}
    for bot in pipe_data:
        src_qs = pipe_data[bot].get('source-queue', '')
        src_qs = [src_qs]
        dst_qs = pipe_data[bot].get('destination-queues', [])
        for q in src_qs:
            if q in sqs2bot:
                qb = sqs2bot[q]
                qb.append(q)
                sqs2bot[q] = qb
            else:
                sqs2bot[q] = [bot]
        for q in dst_qs:
            if q in dsq_count:
                qb = dsq_count[q]
                qb += 1
                dsq_count[q] = qb
            else:
                dsq_count[q] = 1
    return sqs2bot, dsq_count
