#NEWLINE# def setup_ssh( ) : #NEWLINE# #INDENT# 'Uploads ssh from the local folder specified in config.' #NEWLINE# user = cget ( 'user' ) #NEWLINE# ssh_target_dir = cget ( 'ssh_target' ) #NEWLINE# create_target_directories ( [ ssh_target_dir ] , '700' , user ) #NEWLINE# if ( cget ( 'upload_ssh_keys_from_local' ) or True ) : #NEWLINE# #INDENT# files = cget ( 'ssh_files' ) #NEWLINE# if ( not files ) : #NEWLINE# #INDENT# show ( yellow ( 'No SSH files to upload.' ) ) #NEWLINE# return #NEWLINE# #UNINDENT# show ( yellow ( 'Uploading SSH configuration and keys' ) ) #NEWLINE# for name in files : #NEWLINE# #INDENT# show ( 'File: {0}' . format ( name ) ) #NEWLINE# local_path = pjoin ( local_files_dir ( 'ssh' ) , name ) #NEWLINE# remote_path = pjoin ( ssh_target_dir , name ) #NEWLINE# put_file_with_perms ( local_path , remote_path , '600' , user , user ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( 'Not implemented! Please set upload_ssh_keys_from_local to True!' )