def _map_nodes(meta):
 services = Table('services', meta, autoload=True)
 c_nodes = Table('compute_nodes', meta, autoload=True)
 q = select([services.c.host, c_nodes.c.hypervisor_hostname], whereclause=and_((c_nodes.c.deleted == False), (services.c.deleted == False)), from_obj=c_nodes.join(services, (c_nodes.c.service_id == services.c.id)))
 nodemap = {}
 for (host, node) in q.execute():
  nodes = nodemap.setdefault(host, [])
  nodes.append(node)
 return nodemap

def _map_nodes ( meta ) : services = Table ( 'services' , meta , autoload = True ) c_nodes = Table ( 'compute_nodes' , meta , autoload = True ) q = select ( [ services . c . host , c_nodes . c . hypervisor_hostname ] , whereclause = and_ ( ( c_nodes . c . deleted == False ) , ( services . c . deleted == False ) ) , from_obj = c_nodes . join ( services , ( c_nodes . c . service_id == services . c . id ) ) ) nodemap = { } for ( host , node ) in q . execute ( ) : nodes = nodemap . setdefault ( host , [ ] ) nodes . append ( node ) return nodemap
map host to compute node(s) for the purpose of determining which hosts are single vs multi-node .