Skip to content

Commit d22c8ba

Browse files
committed
remove copy of local file to
be replayed. this is not required anymore and is a waste of resources because these files are no longer modified in any way during a test. we used to sometimes modify these with update_timestamps which is no longer supported.
1 parent d36f659 commit d22c8ba

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

contentctl/actions/detection_testing/infrastructures/DetectionTestingInfrastructure.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import time
88
import urllib.parse
99
import uuid
10-
from shutil import copyfile
1110
from ssl import SSLEOFError, SSLZeroReturnError
1211
from sys import stdout
1312
from tempfile import TemporaryDirectory, mktemp
@@ -1402,7 +1401,6 @@ def replay_attack_data_file(
14021401
f"The only valid indexes on the server are {self.all_indexes_on_server}"
14031402
)
14041403

1405-
tempfile = mktemp(dir=tmp_dir)
14061404
if not (
14071405
str(attack_data_file.data).startswith("http://")
14081406
or str(attack_data_file.data).startswith("https://")
@@ -1415,13 +1413,7 @@ def replay_attack_data_file(
14151413
test_group_start_time,
14161414
)
14171415

1418-
try:
1419-
copyfile(str(attack_data_file.data), tempfile)
1420-
except Exception as e:
1421-
raise Exception(
1422-
f"Error copying local Attack Data File for [{test_group.name}] - [{attack_data_file.data}]: "
1423-
f"{str(e)}"
1424-
)
1416+
tempfile = str(attack_data_file.data)
14251417
else:
14261418
raise Exception(
14271419
f"Attack Data File for [{test_group.name}] is local [{attack_data_file.data}], but does not exist."
@@ -1432,6 +1424,7 @@ def replay_attack_data_file(
14321424
# We need to overwrite the file - mkstemp will create an empty file with the
14331425
# given name
14341426
try:
1427+
tempfile = mktemp(dir=tmp_dir)
14351428
# In case the path is a local file, try to get it
14361429

14371430
self.format_pbar_string(

0 commit comments

Comments
 (0)