@bottle.route(url_base + '/<tenant_id>/datacenters/<datacenter_id>/networks', method='GET')  #deprecated
@bottle.route(url_base + '/<tenant_id>/datacenters/<datacenter_id>/netmaps', method='GET')
@bottle.route(url_base + '/<tenant_id>/datacenters/<datacenter_id>/netmaps/<netmap_id>', method='GET')
def http_getnetmap_datacenter_id(tenant_id, datacenter_id, netmap_id=None):
    '''get datacenter networks, can use both uuid or name'''
    #obtain data
    result, datacenter_dict = mydb.get_table_by_uuid_name('datacenters', datacenter_id, "datacenter") 
    if result < 0:
        print "http_getnetwork_datacenter_id error %d %s" % (result, datacenter_dict)
        bottle.abort(-result, datacenter_dict)
    where_= {"datacenter_id":datacenter_dict['uuid']}
    if netmap_id:
        if af.check_valid_uuid(netmap_id):
            where_["uuid"] = netmap_id
        else:
            where_["name"] = netmap_id
    result, content =mydb.get_table(FROM='datacenter_nets',
                                    SELECT=('name','vim_net_id as vim_id', 'uuid', 'type','multipoint','shared','description', 'created_at'),
                                    WHERE=where_ ) 
    if result < 0:
        print (result, content) % "http_getnetwork_datacenter_id error %d %s"
        bottle.abort(-result, content)

    convert_datetime2str(content)
    af.convert_str2boolean(content, ('shared', 'multipoint') )
    if netmap_id and len(content)==1:
        data={'netmap' : content[0]}
    elif netmap_id and len(content)==0:
        bottle.abort(HTTP_Not_Found, "No netmap found with " + " and ".join(map(lambda x: str(x[0])+": "+str(x[1]), where_.iteritems())) )
        return 
    else:
        data={'netmaps' : content}
    return format_out(data)
dataset/ETHPy150Open nfvlabs/openmano/openmano/httpserver.py/http_getnetmap_datacenter_id/swapped operands of `%`