Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
19b6c4a9
Commit
19b6c4a9
authored
Jul 26, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! Add Python 3 support
parent
15afc959
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
slapos/cli/cache.py
slapos/cli/cache.py
+2
-1
slapos/cli/cache_source.py
slapos/cli/cache_source.py
+2
-1
No files found.
slapos/cli/cache.py
View file @
19b6c4a9
...
...
@@ -39,6 +39,7 @@ import prettytable
from
slapos.grid
import
networkcache
from
slapos.grid.distribution
import
distribution_tuple
from
slapos.cli.config
import
ConfigCommand
from
slapos.util
import
str2bytes
FAILURE_EXIT_CODE
=
10
...
...
@@ -77,7 +78,7 @@ def do_lookup(logger, cache_dir, software_url):
if
looks_like_md5
(
software_url
):
md5
=
software_url
else
:
md5
=
hashlib
.
md5
(
s
oftware_url
).
hexdigest
()
md5
=
hashlib
.
md5
(
s
tr2bytes
(
software_url
)
).
hexdigest
()
try
:
url
=
'%s/%s'
%
(
cache_dir
,
md5
)
logger
.
debug
(
'Connecting to %s'
,
url
)
...
...
slapos/cli/cache_source.py
View file @
19b6c4a9
...
...
@@ -39,6 +39,7 @@ import prettytable
from
slapos.grid
import
networkcache
from
slapos.cli.config
import
ConfigCommand
from
slapos.cli.list
import
resetLogger
from
slapos.util
import
str2bytes
class
CacheLookupCommand
(
ConfigCommand
):
"""
...
...
@@ -63,7 +64,7 @@ class CacheLookupCommand(ConfigCommand):
sys
.
exit
(
do_lookup
(
self
.
app
.
log
,
cache_dir
,
args
.
url
))
def
do_lookup
(
logger
,
cache_dir
,
url
):
md5
=
hashlib
.
md5
(
url
).
hexdigest
()
md5
=
hashlib
.
md5
(
str2bytes
(
url
)
).
hexdigest
()
try
:
cached_url
=
'%s/slapos-buildout-%s'
%
(
cache_dir
,
md5
)
...
...
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