#NEWLINE# def find_agent_host_id( this_host ) : #NEWLINE# #INDENT# 'Returns the neutron agent host id for RHEL-OSP6 HA setup.' #NEWLINE# host_id = this_host #NEWLINE# try : #NEWLINE# #INDENT# for ( root , dirs , files ) in os . walk ( '/run/resource-agents' ) : #NEWLINE# #INDENT# for fi in files : #NEWLINE# #INDENT# if ( 'neutron-scale-' in fi ) : #NEWLINE# #INDENT# host_id = ( 'neutron-n-' + fi . split ( '-' ) [ 2 ] ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return host_id #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# return host_id