#NEWLINE# def copy_init_conf_files( node , root_helper ) : #NEWLINE# #INDENT# path = ( os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ) ) ) + '/etc/saf/init/' ) #NEWLINE# dist = platform . dist ( ) [ 0 ] . lower ( ) #NEWLINE# if ( dist not in dist_data ) : #NEWLINE# #INDENT# ( print ( 'This %s Linux distribution is not supported.' ) % dist ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# init_dir = dist_data [ dist ] . get ( 'init_dir' ) #NEWLINE# conf_fn = None #NEWLINE# if ( node == 'control' ) : #NEWLINE# #INDENT# conf_fn = dist_data [ dist ] . get ( 'server_conf' ) #NEWLINE# #UNINDENT# if ( node == 'compute' ) : #NEWLINE# #INDENT# conf_fn = dist_data [ dist ] . get ( 'agent_conf' ) #NEWLINE# #UNINDENT# if ( conf_fn is not None ) : #NEWLINE# #INDENT# cmd = ( root_helper + ( 'cp %s %s' % ( ( path + conf_fn ) , init_dir ) ) ) #NEWLINE# print ( cmd ) #NEWLINE# get_cmd_output ( cmd ) #NEWLINE# if ( ( dist == 'centos' ) or ( dist == 'redhat' ) ) : #NEWLINE# #INDENT# cmd3 = ( root_helper + ( 'systemctl enable %s' % conf_fn ) ) #NEWLINE# print ( cmd3 ) #NEWLINE# get_cmd_output ( cmd3 )