@@ -47,8 +47,10 @@ def launch_process(self, kernel_cmd, **kw):
47
47
if env_dict and 'EGO_SERVICE_CREDENTIAL' in env_dict :
48
48
self .rest_credential = env_dict ['EGO_SERVICE_CREDENTIAL' ]
49
49
else :
50
- self .log .error ("ConductorClusterProcessProxy failed to obtain the Conductor credential." )
51
- raise tornado .web .HTTPError (500 , "ConductorClusterProcessProxy failed to obtain the Conductor credential." )
50
+ error_message = "ConductorClusterProcessProxy failed to obtain the Conductor credential."
51
+ self .log .error (error_message )
52
+ raise tornado .web .HTTPError (500 , reason = error_message )
53
+
52
54
# dynamically update Spark submit parameters
53
55
self .update_launch_info (kernel_cmd , ** kw )
54
56
# Enable stderr PIPE for the run command
@@ -197,10 +199,11 @@ def confirm_remote_startup(self, kernel_cmd, **kw):
197
199
app_state = self .get_application_state ()
198
200
199
201
if app_state in ConductorClusterProcessProxy .final_states :
200
- raise tornado .web .HTTPError (500 , "KernelID: '{}', ApplicationID: '{}' unexpectedly found in"
201
- "state '{}' during kernel startup!" .format (self .kernel_id ,
202
- self .application_id ,
203
- app_state ))
202
+ error_message = "KernelID: '{}', ApplicationID: '{}' unexpectedly found in " \
203
+ "state '{}' during kernel startup!" .\
204
+ format (self .kernel_id , self .application_id , app_state )
205
+ self .log .error (error_message )
206
+ raise tornado .web .HTTPError (500 , reason = error_message )
204
207
205
208
self .log .debug ("{}: State: '{}', Host: '{}', KernelID: '{}', ApplicationID: '{}'" .
206
209
format (i , app_state , self .assigned_host , self .kernel_id , self .application_id ))
@@ -243,7 +246,7 @@ def handle_timeout(self):
243
246
self .kill ()
244
247
timeout_message = "KernelID: '{}' launch timeout due to: {}" .format (self .kernel_id , reason )
245
248
self .log .error (timeout_message )
246
- raise tornado .web .HTTPError (error_http_code , timeout_message )
249
+ raise tornado .web .HTTPError (error_http_code , reason = timeout_message )
247
250
248
251
def get_application_id (self , ignore_final_states = False ):
249
252
# Return the kernel's application ID if available, otherwise None. If we're obtaining application_id
@@ -380,7 +383,7 @@ def kill_app_by_driver_id(self, driver_id):
380
383
if self .application_id is None :
381
384
return None
382
385
self .log .debug ("Driver does not exist, retrieving DriverID with ApplicationID: {}" .format (self .application_id ))
383
- driver_info = get_driver_by_app_id (self .application_id )
386
+ driver_info = self . get_driver_by_app_id (self .application_id )
384
387
if driver_info :
385
388
self .driver_id = driver_info ['id' ]
386
389
else :
0 commit comments