#NEWLINE# def install( self , params ) : #NEWLINE# #INDENT# if ( 'installer' in params ) : #NEWLINE# #INDENT# self . INSTALLER = params . installer #NEWLINE# #UNINDENT# self . _update_system ( params ) #NEWLINE# self . _stop_agent ( params ) #NEWLINE# response = self . s3 . get_object ( Bucket = params . bucket , Key = params . key ) #NEWLINE# with open ( self . INSTALLER , 'wb' ) as f : #NEWLINE# #INDENT# f . write ( response [ 'Body' ] . read ( ) ) #NEWLINE# #UNINDENT# subprocess . check_call ( [ 'chmod' , '+x' , './{0}' . format ( self . INSTALLER ) ] ) #NEWLINE# credentials = self . session . get_credentials ( ) #NEWLINE# environment = os . environ . copy ( ) #NEWLINE# environment [ 'AWS_REGION' ] = params . region #NEWLINE# environment [ 'AWS_ACCESS_KEY_ID' ] = credentials . access_key #NEWLINE# environment [ 'AWS_SECRET_ACCESS_KEY' ] = credentials . secret_key #NEWLINE# if ( credentials . token is not None ) : #NEWLINE# #INDENT# environment [ 'AWS_SESSION_TOKEN' ] = environment . token #NEWLINE# #UNINDENT# subprocess . check_call ( [ './{0}' . format ( self . INSTALLER ) , 'auto' ] , env = environment )