Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.build
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
Ayush Tiwari
slapos.recipe.build
Commits
8c35b2a4
Commit
8c35b2a4
authored
Oct 29, 2018
by
Bryton Lacquement
🚪
Committed by
Julien Muchembled
Oct 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shared: fix signature test under Python 3
parent
d11daca2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
slapos/recipe/downloadunpacked.py
slapos/recipe/downloadunpacked.py
+3
-2
No files found.
slapos/recipe/downloadunpacked.py
View file @
8c35b2a4
...
@@ -243,7 +243,7 @@ class Signature:
...
@@ -243,7 +243,7 @@ class Signature:
def
update
(
self
,
key
,
value
):
def
update
(
self
,
key
,
value
):
self
.
item_list
.
append
((
'%r: %r'
%
(
key
,
value
)).
encode
())
self
.
item_list
.
append
((
'%r: %r'
%
(
key
,
value
)).
encode
())
def
hexdigest
(
self
):
def
hexdigest
(
self
):
# -> str
m
=
md5
()
m
=
md5
()
for
item
in
self
.
item_list
:
for
item
in
self
.
item_list
:
m
.
update
(
item
)
m
.
update
(
item
)
...
@@ -253,8 +253,9 @@ class Signature:
...
@@ -253,8 +253,9 @@ class Signature:
return
b'
\
n
'
.
join
(
self
.
item_list
)
return
b'
\
n
'
.
join
(
self
.
item_list
)
def
test
(
self
,
folder_path
):
def
test
(
self
,
folder_path
):
assert
type
(
folder_path
)
is
str
,
folder_path
digest
=
self
.
hexdigest
()
digest
=
self
.
hexdigest
()
if
os
.
path
.
basename
(
folder_path
)
.
encode
(
'utf-8'
)
==
digest
:
if
os
.
path
.
basename
(
folder_path
)
==
digest
:
target_path
=
os
.
path
.
join
(
folder_path
,
self
.
filename
)
target_path
=
os
.
path
.
join
(
folder_path
,
self
.
filename
)
if
os
.
path
.
exists
(
target_path
)
and
open
(
target_path
,
'rb'
).
read
()
==
self
.
dumps
():
if
os
.
path
.
exists
(
target_path
)
and
open
(
target_path
,
'rb'
).
read
()
==
self
.
dumps
():
return
True
return
True
...
...
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