#NEWLINE# def file_find( filename , user_file = None , pass_exception = False ) : #NEWLINE# #INDENT# 'Return the path to a file.\n\n    If no file is found the system will exit.\n    The file lookup will be done in the following directories:\n      /etc/openstack_deploy/\n      $(pwd)/openstack_deploy/\n\n    :param filename: ``str``  Name of the file to find\n    :param user_file: ``str`` Additional location to look in FIRST for a file\n    ' #NEWLINE# file_check = [ os . path . join ( '/etc' , 'openstack_deploy' , filename ) , os . path . join ( os . getcwd ( ) , filename ) ] #NEWLINE# if ( user_file is not None ) : #NEWLINE# #INDENT# file_check . insert ( 0 , os . path . expanduser ( user_file ) ) #NEWLINE# #UNINDENT# for filename in file_check : #NEWLINE# #INDENT# if os . path . isfile ( filename ) : #NEWLINE# #INDENT# return filename #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( pass_exception is False ) : #NEWLINE# #INDENT# raise SystemExit ( ( 'No file found at: %s' % file_check ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return False