#NEWLINE# def _read_compute_topology( ) : #NEWLINE# #INDENT# LOG . debug ( 'Reading compute nodes topology from {config}' . format ( config = CONF . compute_topology_file ) ) #NEWLINE# ctx = context . ctx ( ) #NEWLINE# tenant_id = str ( ctx . tenant_id ) #NEWLINE# topology = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# with open ( CONF . compute_topology_file ) as f : #NEWLINE# #INDENT# for line in f : #NEWLINE# #INDENT# line = line . strip ( ) #NEWLINE# if ( not line ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( host , path ) = line . split ( ) #NEWLINE# sha_hash = hashlib . sha224 ( ( line + host ) ) #NEWLINE# topology [ sha_hash . hexdigest ( ) ] = path #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except IOError : #NEWLINE# #INDENT# raise ex . NotFoundException ( CONF . compute_topology_file , _ ( 'Unable to find file %s with compute topology' ) ) #NEWLINE# #UNINDENT# return topology