Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eric Zheng
slapos.toolbox
Commits
a2b8dbbd
Commit
a2b8dbbd
authored
6 years ago
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resilient: do not compute the signature for same file several times
parent
56895d5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
slapos/resilient/runner_utils.py
slapos/resilient/runner_utils.py
+23
-20
No files found.
slapos/resilient/runner_utils.py
View file @
a2b8dbbd
...
...
@@ -109,6 +109,7 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign
continue
# Find if special signature function should be applied
signature_process
=
None
for
special_slappart
in
special_slappart_list
:
backup_identity_script_path
=
os
.
path
.
join
(
runner_working_path
,
...
...
@@ -121,30 +122,32 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
)
break
(
output
,
error_output
)
=
signature_process
.
communicate
(
'
\
0
'
.
join
([
os
.
path
.
join
(
dirpath
,
filename
)
for
filename
in
filename_list
])
)
if
signature_process
:
(
output
,
error_output
)
=
signature_process
.
communicate
(
'
\
0
'
.
join
([
os
.
path
.
join
(
dirpath
,
filename
)
for
filename
in
filename_list
])
)
if
signature_process
.
returncode
!=
0
:
print
(
"An issue occured when calculating the custom signature"
" with %s :
\
n
%s"
%
(
backup_identity_script_path
,
error_output
)
if
signature_process
.
returncode
!=
0
:
print
(
"An issue occured when calculating the custom signature"
" with %s :
\
n
%s
\
n
%s"
%
(
backup_identity_script_path
,
output
,
error_output
)
sys
.
exit
(
1
)
# We have to rstrip as most programs return an empty line
# at the end of their output
signature_list
.
extend
(
output
.
strip
(
'
\
n
'
).
split
(
'
\
n
'
))
else
:
signature_list
.
extend
(
getSha256Sum
([
os
.
path
.
join
(
dirpath
,
filename
)
for
filename
in
filename_list
])
)
sys
.
exit
(
1
)
# We have to rstrip as most programs return an empty line
# at the end of their output
signature_list
.
extend
(
output
.
strip
(
'
\
n
'
).
split
(
'
\
n
'
))
else
:
signature_list
.
extend
(
getSha256Sum
([
os
.
path
.
join
(
dirpath
,
filename
)
for
filename
in
filename_list
])
)
# Write the signatures in file
with
open
(
signature_file_path
,
'w+'
)
as
signature_file
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment