File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,16 @@ def clone_client(num_clients: int, dest_poc_folder):
3232 shutil .rmtree (src_folder )
3333
3434
35- def unpack_poc () -> bool :
35+ def unpack_poc (dest_poc_folder ) -> bool :
3636 file_dir_path = pathlib .Path (__file__ ).parent .absolute ()
3737 poc_zip_path = file_dir_path .parent / "poc.zip"
3838 try :
39- shutil .unpack_archive (poc_zip_path )
39+ import tempfile
40+
41+ with tempfile .TemporaryDirectory () as tmp_dir :
42+ shutil .unpack_archive (poc_zip_path , extract_dir = tmp_dir )
43+ copy_from_src (os .path .join (tmp_dir , "poc" ), dest_poc_folder )
44+
4045 return True
4146 except shutil .ReadError :
4247 return False
@@ -52,7 +57,7 @@ def copy_from_src(src_poc_folder, dest_poc_folder):
5257
5358def clone_poc_folder (src_poc_folder , dest_poc_folder ):
5459 shutil .rmtree (dest_poc_folder , ignore_errors = True )
55- success = unpack_poc ()
60+ success = unpack_poc (dest_poc_folder )
5661 if not success :
5762 copy_from_src (src_poc_folder , dest_poc_folder )
5863
Original file line number Diff line number Diff line change @@ -329,15 +329,6 @@ def def_poc_parser(sub_cmd):
329329 return {cmd : poc_parser }
330330
331331
332- def is_poc (cmd_args ) -> bool :
333- return (
334- hasattr (cmd_args , "start_poc" )
335- or hasattr (cmd_args , "prepare_poc" )
336- or hasattr (cmd_args , "stop_poc" )
337- or hasattr (cmd_args , "clean_poc" )
338- )
339-
340-
341332def get_local_host_gpu_ids ():
342333 try :
343334 return get_host_gpu_ids ()
You can’t perform that action at this time.
0 commit comments