#NEWLINE# def run_only_once( self , keyword ) : #NEWLINE# #INDENT# '\n        This is an *experimental* keyword for building setups that should be executed only once.\n        As the keyword will be called only in one process and the return value could basically be anything.\n        The "Run Only Once" can\'t return the actual value.\n        If the keyword fails, "Run Only Once" fails.\n        Others executing "Run Only Once" wait before going through this keyword before the actual command has been executed.\n        NOTE! This is a potential "Shoot yourself in to knee" keyword\n        Especially note that all the namespace changes are only visible in the process that actually executed the keyword.\n        Also note that this might lead to odd situations if used inside of other keywords.\n        Also at this point the keyword will be identified to be same if it has the same name.\n        ' #NEWLINE# lock_name = ( 'pabot_run_only_once_%s' % keyword ) #NEWLINE# try : #NEWLINE# #INDENT# self . acquire_lock ( lock_name ) #NEWLINE# passed = self . get_parallel_value_for_key ( lock_name ) #NEWLINE# if ( passed != '' ) : #NEWLINE# #INDENT# if ( passed == 'FAILED' ) : #NEWLINE# #INDENT# raise AssertionError ( 'Keyword failed in other process' ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# BuiltIn ( ) . run_keyword ( keyword ) #NEWLINE# self . set_parallel_value_for_key ( lock_name , 'PASSED' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# self . set_parallel_value_for_key ( lock_name , 'FAILED' ) #NEWLINE# raise #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . release_lock ( lock_name )