@@ -197,7 +197,7 @@ def setup(self):
197197 self .check_for_teardown ()
198198
199199 except Exception as e :
200- msg = f"[{ self .get_name ()} ]: { str ( e ) } "
200+ msg = f"[{ self .get_name ()} ]: { e !s } "
201201 self .finish ()
202202 if isinstance (e , ExceptionGroup ):
203203 raise ExceptionGroup (msg , e .exceptions ) from e # type: ignore
@@ -310,7 +310,7 @@ def configure_hec(self):
310310 return
311311
312312 except Exception as e :
313- raise (Exception (f"Failure creating HEC Endpoint: { str ( e ) } " ))
313+ raise (Exception (f"Failure creating HEC Endpoint: { e !s } " ))
314314
315315 def get_all_indexes (self ) -> None :
316316 """
@@ -327,7 +327,7 @@ def get_all_indexes(self) -> None:
327327 # Retrieve all available indexes on the splunk instance
328328 self .all_indexes_on_server = indexes
329329 except Exception as e :
330- raise (Exception (f"Failure getting indexes: { str ( e ) } " ))
330+ raise (Exception (f"Failure getting indexes: { e !s } " ))
331331
332332 def get_conn (self ) -> client .Service :
333333 try :
@@ -382,7 +382,7 @@ def connect_to_api(self, sleep_seconds: int = 5):
382382 pass
383383 except Exception as e :
384384 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 } "
386386 )
387387
388388 for _ in range (sleep_seconds ):
@@ -402,7 +402,7 @@ def create_replay_index(self):
402402 pass
403403 else :
404404 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 } "
406406 )
407407
408408 def configure_imported_roles (
@@ -426,7 +426,7 @@ def configure_imported_roles(
426426 )
427427 return
428428 except Exception as e :
429- msg = f"Error configuring roles: { str ( e ) } "
429+ msg = f"Error configuring roles: { e !s } "
430430 self .pbar .write (msg )
431431 raise Exception (msg ) from e
432432
@@ -436,7 +436,7 @@ def configure_delete_indexes(self):
436436 self .get_conn ().post (endpoint , value = ";" .join (self .all_indexes_on_server ))
437437 except Exception as e :
438438 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 } ]"
440440 )
441441
442442 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"):
474474 parser .read (custom_acceleration_datamodels )
475475 if len (parser .keys ()) > 1 :
476476 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 } !"
478478 )
479479
480480 if not cim_acceleration_datamodels .is_file ():
481481 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 "
483483 "FOUND. CIM DATAMODELS NOT ACCELERATED\n ******************************\n "
484484 )
485485 else :
@@ -499,7 +499,7 @@ def configure_conf_file_datamodels(self, APP_NAME: str = "Splunk_SA_CIM"):
499499
500500 except Exception as e :
501501 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 } "
503503 )
504504
505505 def execute (self ):
@@ -528,9 +528,7 @@ def execute(self):
528528 self .finish ()
529529 return
530530 except Exception as e :
531- self .pbar .write (
532- f"Error testing detection: { type (e ).__name__ } : { str (e )} "
533- )
531+ self .pbar .write (f"Error testing detection: { type (e ).__name__ } : { e !s} " )
534532 raise e
535533 finally :
536534 self .sync_obj .outputQueue .append (detection )
@@ -1365,7 +1363,7 @@ def delete_attack_data(self, attack_data_files: list[TestAttackData]):
13651363 except Exception as e :
13661364 raise (
13671365 Exception (
1368- f"Trouble deleting data using the search { splunk_search } : { str ( e ) } "
1366+ f"Trouble deleting data using the search { splunk_search } : { e !s } "
13691367 )
13701368 )
13711369
@@ -1440,7 +1438,7 @@ def replay_attack_data_file(
14401438 except Exception as e :
14411439 raise (
14421440 Exception (
1443- f"Could not download attack data file [{ attack_data_file .data } ]:{ str ( e ) } "
1441+ f"Could not download attack data file [{ attack_data_file .data } ]:{ e !s } "
14441442 )
14451443 )
14461444
@@ -1514,7 +1512,7 @@ def hec_raw_replay(
15141512 except Exception as e :
15151513 raise (
15161514 Exception (
1517- f"There was an exception sending attack_data to HEC: { str ( e ) } "
1515+ f"There was an exception sending attack_data to HEC: { e !s } "
15181516 )
15191517 )
15201518
@@ -1558,7 +1556,7 @@ def hec_raw_replay(
15581556 )
15591557 )
15601558 except Exception as e :
1561- raise (Exception (f"There was an exception in the post: { str ( e ) } " ))
1559+ raise (Exception (f"There was an exception in the post: { e !s } " ))
15621560
15631561 def status (self ):
15641562 pass
0 commit comments