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
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.toolbox
Commits
cc48059a
Commit
cc48059a
authored
Nov 07, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner_exporter: limit the number of files passed to the signature function
parent
3c386718
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
slapos/resilient/runner_exporter.py
slapos/resilient/runner_exporter.py
+14
-5
No files found.
slapos/resilient/runner_exporter.py
View file @
cc48059a
...
...
@@ -3,6 +3,7 @@ from __future__ import print_function
import
argparse
import
errno
import
glob
import
itertools
import
os
import
re
import
shutil
...
...
@@ -211,12 +212,20 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign
signature_function
=
getSha256Sum
# Calculate the signature of all files in this directory
signature_list
.
extend
(
signature_function
([
os
.
path
.
join
(
dirpath
,
filename
)
for
filename
in
filename_list
])
# The number of files passed to the signature function is
# hardcoded in max_argument_number
max_argument_number
=
10
file_list_generator
=
(
os
.
path
.
join
(
dirpath
,
filename
)
for
filename
in
filename_list
)
arg_list
=
[
file_list_generator
]
*
max_argument_number
for
file_list
in
itertools
.
izip_longest
(
*
arg_list
):
# izip_longest fills with None
file_list
=
[
x
for
x
in
file_list
if
x
]
signature_list
.
extend
(
signature_function
(
file_list
)
)
# Write the signatures in file
with
open
(
signature_file_path
,
'w+'
)
as
signature_file
:
...
...
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