@@ -197,7 +197,7 @@ def setup(self):
197
197
self .check_for_teardown ()
198
198
199
199
except Exception as e :
200
- msg = f"[{ self .get_name ()} ]: { str ( e ) } "
200
+ msg = f"[{ self .get_name ()} ]: { e !s } "
201
201
self .finish ()
202
202
if isinstance (e , ExceptionGroup ):
203
203
raise ExceptionGroup (msg , e .exceptions ) from e # type: ignore
@@ -310,7 +310,7 @@ def configure_hec(self):
310
310
return
311
311
312
312
except Exception as e :
313
- raise (Exception (f"Failure creating HEC Endpoint: { str ( e ) } " ))
313
+ raise (Exception (f"Failure creating HEC Endpoint: { e !s } " ))
314
314
315
315
def get_all_indexes (self ) -> None :
316
316
"""
@@ -327,7 +327,7 @@ def get_all_indexes(self) -> None:
327
327
# Retrieve all available indexes on the splunk instance
328
328
self .all_indexes_on_server = indexes
329
329
except Exception as e :
330
- raise (Exception (f"Failure getting indexes: { str ( e ) } " ))
330
+ raise (Exception (f"Failure getting indexes: { e !s } " ))
331
331
332
332
def get_conn (self ) -> client .Service :
333
333
try :
@@ -382,7 +382,7 @@ def connect_to_api(self, sleep_seconds: int = 5):
382
382
pass
383
383
except Exception as e :
384
384
self .pbar .write (
385
- f"Error getting API connection (not quitting) '{ type (e ).__name__ } ': { str ( e ) } "
385
+ f"Error getting API connection (not quitting) '{ type (e ).__name__ } ': { e !s } "
386
386
)
387
387
388
388
for _ in range (sleep_seconds ):
@@ -402,7 +402,7 @@ def create_replay_index(self):
402
402
pass
403
403
else :
404
404
raise Exception (
405
- f"Error creating index { self .sync_obj .replay_index } - { str ( e ) } "
405
+ f"Error creating index { self .sync_obj .replay_index } - { e !s } "
406
406
)
407
407
408
408
def configure_imported_roles (
@@ -426,7 +426,7 @@ def configure_imported_roles(
426
426
)
427
427
return
428
428
except Exception as e :
429
- msg = f"Error configuring roles: { str ( e ) } "
429
+ msg = f"Error configuring roles: { e !s } "
430
430
self .pbar .write (msg )
431
431
raise Exception (msg ) from e
432
432
@@ -436,7 +436,7 @@ def configure_delete_indexes(self):
436
436
self .get_conn ().post (endpoint , value = ";" .join (self .all_indexes_on_server ))
437
437
except Exception as e :
438
438
self .pbar .write (
439
- f"Error configuring deleteIndexesAllowed with '{ self .all_indexes_on_server } ': [{ str ( e ) } ]"
439
+ f"Error configuring deleteIndexesAllowed with '{ self .all_indexes_on_server } ': [{ e !s } ]"
440
440
)
441
441
442
442
def wait_for_conf_file (self , app_name : str , conf_file_name : str ):
@@ -474,12 +474,12 @@ def configure_conf_file_datamodels(self, APP_NAME: str = "Splunk_SA_CIM"):
474
474
parser .read (custom_acceleration_datamodels )
475
475
if len (parser .keys ()) > 1 :
476
476
self .pbar .write (
477
- f"Read { len (parser ) - 1 } custom datamodels from { str ( custom_acceleration_datamodels ) } !"
477
+ f"Read { len (parser ) - 1 } custom datamodels from { custom_acceleration_datamodels !s } !"
478
478
)
479
479
480
480
if not cim_acceleration_datamodels .is_file ():
481
481
self .pbar .write (
482
- f"******************************\n DATAMODEL ACCELERATION FILE { str ( cim_acceleration_datamodels ) } NOT "
482
+ f"******************************\n DATAMODEL ACCELERATION FILE { cim_acceleration_datamodels !s } NOT "
483
483
"FOUND. CIM DATAMODELS NOT ACCELERATED\n ******************************\n "
484
484
)
485
485
else :
@@ -499,7 +499,7 @@ def configure_conf_file_datamodels(self, APP_NAME: str = "Splunk_SA_CIM"):
499
499
500
500
except Exception as e :
501
501
self .pbar .write (
502
- f"Error creating the conf Datamodel { datamodel_name } key/value { name } /{ value } : { str ( e ) } "
502
+ f"Error creating the conf Datamodel { datamodel_name } key/value { name } /{ value } : { e !s } "
503
503
)
504
504
505
505
def execute (self ):
@@ -529,7 +529,7 @@ def execute(self):
529
529
return
530
530
except Exception as e :
531
531
self .pbar .write (
532
- f"Error testing detection: { type (e ).__name__ } : { str ( e ) } "
532
+ f"Error testing detection: { type (e ).__name__ } : { e !s } "
533
533
)
534
534
raise e
535
535
finally :
@@ -1365,7 +1365,7 @@ def delete_attack_data(self, attack_data_files: list[TestAttackData]):
1365
1365
except Exception as e :
1366
1366
raise (
1367
1367
Exception (
1368
- f"Trouble deleting data using the search { splunk_search } : { str ( e ) } "
1368
+ f"Trouble deleting data using the search { splunk_search } : { e !s } "
1369
1369
)
1370
1370
)
1371
1371
@@ -1440,7 +1440,7 @@ def replay_attack_data_file(
1440
1440
except Exception as e :
1441
1441
raise (
1442
1442
Exception (
1443
- f"Could not download attack data file [{ attack_data_file .data } ]:{ str ( e ) } "
1443
+ f"Could not download attack data file [{ attack_data_file .data } ]:{ e !s } "
1444
1444
)
1445
1445
)
1446
1446
@@ -1514,7 +1514,7 @@ def hec_raw_replay(
1514
1514
except Exception as e :
1515
1515
raise (
1516
1516
Exception (
1517
- f"There was an exception sending attack_data to HEC: { str ( e ) } "
1517
+ f"There was an exception sending attack_data to HEC: { e !s } "
1518
1518
)
1519
1519
)
1520
1520
@@ -1558,7 +1558,7 @@ def hec_raw_replay(
1558
1558
)
1559
1559
)
1560
1560
except Exception as e :
1561
- raise (Exception (f"There was an exception in the post: { str ( e ) } " ))
1561
+ raise (Exception (f"There was an exception in the post: { e !s } " ))
1562
1562
1563
1563
def status (self ):
1564
1564
pass
0 commit comments