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
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
Boxiang Sun
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
Hide 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
...
@@ -39,6 +39,7 @@ import prettytable
from
slapos.grid
import
networkcache
from
slapos.grid
import
networkcache
from
slapos.grid.distribution
import
distribution_tuple
from
slapos.grid.distribution
import
distribution_tuple
from
slapos.cli.config
import
ConfigCommand
from
slapos.cli.config
import
ConfigCommand
from
slapos.util
import
str2bytes
FAILURE_EXIT_CODE
=
10
FAILURE_EXIT_CODE
=
10
...
@@ -77,7 +78,7 @@ def do_lookup(logger, cache_dir, software_url):
...
@@ -77,7 +78,7 @@ def do_lookup(logger, cache_dir, software_url):
if
looks_like_md5
(
software_url
):
if
looks_like_md5
(
software_url
):
md5
=
software_url
md5
=
software_url
else
:
else
:
md5
=
hashlib
.
md5
(
s
oftware_url
).
hexdigest
()
md5
=
hashlib
.
md5
(
s
tr2bytes
(
software_url
)
).
hexdigest
()
try
:
try
:
url
=
'%s/%s'
%
(
cache_dir
,
md5
)
url
=
'%s/%s'
%
(
cache_dir
,
md5
)
logger
.
debug
(
'Connecting to %s'
,
url
)
logger
.
debug
(
'Connecting to %s'
,
url
)
...
...
slapos/cli/cache_source.py
View file @
19b6c4a9
...
@@ -39,6 +39,7 @@ import prettytable
...
@@ -39,6 +39,7 @@ import prettytable
from
slapos.grid
import
networkcache
from
slapos.grid
import
networkcache
from
slapos.cli.config
import
ConfigCommand
from
slapos.cli.config
import
ConfigCommand
from
slapos.cli.list
import
resetLogger
from
slapos.cli.list
import
resetLogger
from
slapos.util
import
str2bytes
class
CacheLookupCommand
(
ConfigCommand
):
class
CacheLookupCommand
(
ConfigCommand
):
"""
"""
...
@@ -63,7 +64,7 @@ class CacheLookupCommand(ConfigCommand):
...
@@ -63,7 +64,7 @@ class CacheLookupCommand(ConfigCommand):
sys
.
exit
(
do_lookup
(
self
.
app
.
log
,
cache_dir
,
args
.
url
))
sys
.
exit
(
do_lookup
(
self
.
app
.
log
,
cache_dir
,
args
.
url
))
def
do_lookup
(
logger
,
cache_dir
,
url
):
def
do_lookup
(
logger
,
cache_dir
,
url
):
md5
=
hashlib
.
md5
(
url
).
hexdigest
()
md5
=
hashlib
.
md5
(
str2bytes
(
url
)
).
hexdigest
()
try
:
try
:
cached_url
=
'%s/slapos-buildout-%s'
%
(
cache_dir
,
md5
)
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