#NEWLINE# def LoadComponentOnClient( self , name = None , version = None , next_state = None ) : #NEWLINE# #INDENT# 'Load the component with the specified name and version.' #NEWLINE# if ( next_state is None ) : #NEWLINE# #INDENT# raise TypeError ( 'next_state not specified.' ) #NEWLINE# #UNINDENT# client = aff4 . FACTORY . Open ( self . client_id , token = self . token ) #NEWLINE# system = unicode ( ( client . Get ( client . Schema . SYSTEM ) or '' ) ) . lower ( ) #NEWLINE# request_data = dict ( name = name , version = version , next_state = next_state ) #NEWLINE# python_hack_root_urn = config_lib . CONFIG . Get ( 'Config.python_hack_root' ) #NEWLINE# python_hack_path = python_hack_root_urn . Add ( system ) . Add ( 'restart_if_component_loaded.py' ) #NEWLINE# fd = aff4 . FACTORY . Open ( python_hack_path , token = self . token ) #NEWLINE# if ( not isinstance ( fd , aff4 . GRRSignedBlob ) ) : #NEWLINE# #INDENT# logging . info ( 'Python hack %s not available.' , python_hack_path ) #NEWLINE# self . CallStateInline ( next_state = 'LoadComponentAfterFlushOldComponent' , request_data = request_data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logging . info ( 'Sending python hack %s' , python_hack_path ) #NEWLINE# for python_blob in fd : #NEWLINE# #INDENT# self . CallClient ( 'ExecutePython' , python_code = python_blob , py_args = dict ( name = name , version = version ) , next_state = 'LoadComponentAfterFlushOldComponent' , request_data = request_data )