Commit a2b8dbbd authored by Nicolas Wavrant's avatar Nicolas Wavrant

resilient: do not compute the signature for same file several times

parent 56895d5e
...@@ -109,6 +109,7 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign ...@@ -109,6 +109,7 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign
continue continue
# Find if special signature function should be applied # Find if special signature function should be applied
signature_process = None
for special_slappart in special_slappart_list: for special_slappart in special_slappart_list:
backup_identity_script_path = os.path.join( backup_identity_script_path = os.path.join(
runner_working_path, runner_working_path,
...@@ -121,7 +122,9 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign ...@@ -121,7 +122,9 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
) )
break
if signature_process:
(output, error_output) = signature_process.communicate( (output, error_output) = signature_process.communicate(
'\0'.join([os.path.join(dirpath, filename) for filename in filename_list]) '\0'.join([os.path.join(dirpath, filename) for filename in filename_list])
) )
...@@ -129,8 +132,8 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign ...@@ -129,8 +132,8 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign
if signature_process.returncode != 0: if signature_process.returncode != 0:
print( print(
"An issue occured when calculating the custom signature" "An issue occured when calculating the custom signature"
" with %s :\n%s" % ( " with %s :\n%s\n%s" % (
backup_identity_script_path, error_output backup_identity_script_path, output, error_output
) )
) )
sys.exit(1) sys.exit(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment