diff --git a/openfl/interface/collaborator.py b/openfl/interface/collaborator.py index 9dc62a24f55..c183978c0e7 100644 --- a/openfl/interface/collaborator.py +++ b/openfl/interface/collaborator.py @@ -202,6 +202,8 @@ def generate_cert_request(collaborator_name, data_path, silent, skip_package, from os import remove from glob import glob + from openfl.utilities.utils import rmtree + archive_type = 'zip' archive_name = f'col_{common_name}_to_agg_cert_request' archive_file_name = archive_name + '.' + archive_type @@ -223,6 +225,7 @@ def generate_cert_request(collaborator_name, data_path, silent, skip_package, # Create Zip archive of directory make_archive(archive_name, archive_type, tmp_dir) + rmtree(tmp_dir) echo(f'Archive {archive_file_name} with certificate signing' f' request created') @@ -327,6 +330,7 @@ def certify(collaborator_name, silent, request_pkg=None, import_=False, from openfl.cryptography.io import read_key from openfl.cryptography.io import write_crt from openfl.interface.cli_helper import CERT_DIR + from openfl.utilities.utils import rmtree common_name = f'{collaborator_name}'.lower() @@ -430,6 +434,7 @@ def certify(collaborator_name, silent, request_pkg=None, import_=False, # Create Zip archive of directory make_archive(archive_name, archive_type, tmp_dir) + rmtree(tmp_dir) else: # Copy the signed certificate and cert chain into PKI_DIR @@ -536,6 +541,7 @@ def certify(collaborator_name, silent, request_pkg=None, import_=False, # Create Zip archive of directory make_archive(archive_name, archive_type, tmp_dir) + rmtree(tmp_dir) else: # Copy the signed certificate and cert chain into PKI_DIR