#NEWLINE# def run( self , log_level , master_url , remote_file = None , build_type = None , **request_params ) : #NEWLINE# #INDENT# '\n        Execute a build and wait for it to complete.\n\n        :param log_level: the log level at which to do application logging (or None for default log level)\n        :type log_level: str | None\n        :param master_url: the url (specified by the user) of the master to which we should send the build\n        :type master_url: str | None\n        :param remote_file: a list of remote files where each element contains the output file name and the resource URL\n        :type remote_file: list[list[str]] | None\n        :param build_type: the build type of the request to be sent (e.g., "git", "directory"). If not specified\n            will default to the "directory" project type.\n        :type build_type: str | None\n        :param request_params: key-value pairs to be provided as build parameters in the build request\n        :type request_params: dict\n        ' #NEWLINE# log_level = ( log_level or Configuration [ 'log_level' ] ) #NEWLINE# log . configure_logging ( log_level = log_level , simplified_console_logs = True ) #NEWLINE# request_params [ 'type' ] = ( build_type or request_params . get ( 'type' ) or 'directory' ) #NEWLINE# if remote_file : #NEWLINE# #INDENT# request_params [ 'remote_files' ] = { name : url for ( name , url ) in remote_file } #NEWLINE# #UNINDENT# operational_master_url = ( master_url or '{}:{}' . format ( Configuration [ 'hostname' ] , Configuration [ 'port' ] ) ) #NEWLINE# if ( ( master_url is None ) and Network . are_hosts_same ( Configuration [ 'master_hostname' ] , 'localhost' ) and ( len ( Configuration [ 'slaves' ] ) == 1 ) and Network . are_hosts_same ( Configuration [ 'slaves' ] [ 0 ] , 'localhost' ) ) : #NEWLINE# #INDENT# self . _start_local_services_if_needed ( operational_master_url ) #NEWLINE# #UNINDENT# if ( request_params [ 'type' ] == 'directory' ) : #NEWLINE# #INDENT# request_params [ 'project_directory' ] = ( request_params . get ( 'project_directory' ) or os . getcwd ( ) ) #NEWLINE# #UNINDENT# runner = BuildRunner ( master_url = operational_master_url , request_params = request_params , secret = Secret . get ( ) ) #NEWLINE# if ( not runner . run ( ) ) : #NEWLINE# #INDENT# sys . exit ( 1 )