@@ -291,8 +291,8 @@ def __call__(self):
291
291
"host" : Network .getFQDN (),
292
292
"objectType" : "Operation" ,
293
293
"operationType" : pluginName ,
294
- "objectID" : operation . OperationID ,
295
- "parentID" : operation . RequestID ,
294
+ "objectID" : getattr ( operation , " OperationID" , 0 ) ,
295
+ "parentID" : getattr ( operation , " RequestID" , 0 ) ,
296
296
"status" : "Attempted" ,
297
297
"nbObject" : 1 ,
298
298
}
@@ -313,8 +313,8 @@ def __call__(self):
313
313
"host" : Network .getFQDN (),
314
314
"objectType" : "Operation" ,
315
315
"operationType" : pluginName ,
316
- "objectID" : operation . OperationID ,
317
- "parentID" : operation . RequestID ,
316
+ "objectID" : getattr ( operation , " OperationID" , 0 ) ,
317
+ "parentID" : getattr ( operation , " RequestID" , 0 ) ,
318
318
"status" : "Failed" ,
319
319
"nbObject" : 1 ,
320
320
}
@@ -325,7 +325,7 @@ def __call__(self):
325
325
"timestamp" : int (TimeUtilities .toEpochMilliSeconds ()),
326
326
"host" : Network .getFQDN (),
327
327
"objectType" : "Request" ,
328
- "objectID" : operation . RequestID ,
328
+ "objectID" : getattr ( operation , " RequestID" , 0 ) ,
329
329
"status" : "Failed" ,
330
330
"nbObject" : 1 ,
331
331
}
@@ -347,7 +347,10 @@ def __call__(self):
347
347
if operation .Status != "Failed" :
348
348
operation .Status = "Failed"
349
349
self .request .Error = "Job no longer exists"
350
- except Exception as error :
350
+ except Exception as e :
351
+ # We can't do except Exception as error
352
+ # because it masks the local variable
353
+ error = repr (e )
351
354
self .log .exception ("hit by exception:" , error )
352
355
if pluginName :
353
356
if self .rmsMonitoring :
@@ -357,8 +360,8 @@ def __call__(self):
357
360
"host" : Network .getFQDN (),
358
361
"objectType" : "Operation" ,
359
362
"operationType" : pluginName ,
360
- "objectID" : operation . OperationID ,
361
- "parentID" : operation . RequestID ,
363
+ "objectID" : getattr ( operation , " OperationID" , 0 ) ,
364
+ "parentID" : getattr ( operation , " RequestID" , 0 ) ,
362
365
"status" : "Failed" ,
363
366
"nbObject" : 1 ,
364
367
}
@@ -369,7 +372,7 @@ def __call__(self):
369
372
"timestamp" : int (TimeUtilities .toEpochMilliSeconds ()),
370
373
"host" : Network .getFQDN (),
371
374
"objectType" : "Request" ,
372
- "objectID" : operation . RequestID ,
375
+ "objectID" : getattr ( operation , " RequestID" , 0 ) ,
373
376
"status" : "Failed" ,
374
377
"nbObject" : 1 ,
375
378
}
@@ -388,8 +391,8 @@ def __call__(self):
388
391
"host" : Network .getFQDN (),
389
392
"objectType" : "Operation" ,
390
393
"operationType" : pluginName ,
391
- "objectID" : operation . OperationID ,
392
- "parentID" : operation . RequestID ,
394
+ "objectID" : getattr ( operation , " OperationID" , 0 ) ,
395
+ "parentID" : getattr ( operation , " RequestID" , 0 ) ,
393
396
"status" : "Successful" ,
394
397
"nbObject" : 1 ,
395
398
}
@@ -402,8 +405,8 @@ def __call__(self):
402
405
"host" : Network .getFQDN (),
403
406
"objectType" : "Operation" ,
404
407
"operationType" : pluginName ,
405
- "objectID" : operation . OperationID ,
406
- "parentID" : operation . RequestID ,
408
+ "objectID" : getattr ( operation , " OperationID" , 0 ) ,
409
+ "parentID" : getattr ( operation , " RequestID" , 0 ) ,
407
410
"status" : "Failed" ,
408
411
"nbObject" : 1 ,
409
412
}
0 commit comments