#NEWLINE# @ staticmethod #NEWLINE# def load( path , name , cluster ) : #NEWLINE# #INDENT# '\n        Load a node from from the path on disk to the config files, the node name and the\n        cluster the node is part of.\n        ' #NEWLINE# node_path = os . path . join ( path , name ) #NEWLINE# filename = os . path . join ( node_path , 'node.conf' ) #NEWLINE# with open ( filename , 'r' ) as f : #NEWLINE# #INDENT# data = yaml . load ( f ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# itf = data [ 'interfaces' ] #NEWLINE# initial_token = None #NEWLINE# if ( 'initial_token' in data ) : #NEWLINE# #INDENT# initial_token = data [ 'initial_token' ] #NEWLINE# #UNINDENT# remote_debug_port = 2000 #NEWLINE# if ( 'remote_debug_port' in data ) : #NEWLINE# #INDENT# remote_debug_port = data [ 'remote_debug_port' ] #NEWLINE# #UNINDENT# binary_interface = None #NEWLINE# if ( ( 'binary' in itf ) and ( itf [ 'binary' ] is not None ) ) : #NEWLINE# #INDENT# binary_interface = tuple ( itf [ 'binary' ] ) #NEWLINE# #UNINDENT# node = cluster . create_node ( data [ 'name' ] , data [ 'auto_bootstrap' ] , tuple ( itf [ 'thrift' ] ) , tuple ( itf [ 'storage' ] ) , data [ 'jmx_port' ] , remote_debug_port , initial_token , save = False , binary_interface = binary_interface , byteman_port = data [ 'byteman_port' ] ) #NEWLINE# node . status = data [ 'status' ] #NEWLINE# if ( 'pid' in data ) : #NEWLINE# #INDENT# node . pid = int ( data [ 'pid' ] ) #NEWLINE# #UNINDENT# if ( 'install_dir' in itf ) : #NEWLINE# #INDENT# node . __install_dir = data [ 'install_dir' ] #NEWLINE# #UNINDENT# if ( 'config_options' in data ) : #NEWLINE# #INDENT# node . __config_options = data [ 'config_options' ] #NEWLINE# #UNINDENT# if ( 'dse_config_options' in data ) : #NEWLINE# #INDENT# node . _dse_config_options = data [ 'dse_config_options' ] #NEWLINE# #UNINDENT# if ( 'data_center' in data ) : #NEWLINE# #INDENT# node . data_center = data [ 'data_center' ] #NEWLINE# #UNINDENT# if ( 'workloads' in data ) : #NEWLINE# #INDENT# node . workloads = data [ 'workloads' ] #NEWLINE# #UNINDENT# return node #NEWLINE# #UNINDENT# except KeyError as k : #NEWLINE# #INDENT# raise common . LoadError ( ( ( ( 'Error Loading ' + filename ) + ', missing property: ' ) + str ( k ) ) )