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
Hardik Juneja
slapos.core
Commits
9359dede
Commit
9359dede
authored
Aug 14, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grid: detect platform for binary cache support under cygwin
parent
4e428fdc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
slapos/cli/cache.py
slapos/cli/cache.py
+2
-2
slapos/grid/distribution.py
slapos/grid/distribution.py
+10
-0
slapos/grid/networkcache.py
slapos/grid/networkcache.py
+3
-3
No files found.
slapos/cli/cache.py
View file @
9359dede
...
@@ -10,7 +10,7 @@ import sys
...
@@ -10,7 +10,7 @@ import sys
import
prettytable
import
prettytable
from
slapos.grid
import
networkcache
from
slapos.grid
import
networkcache
from
slapos.grid.distribution
import
patched_linux_distribution
from
slapos.grid.distribution
import
distribution_tuple
from
slapos.cli.config
import
ConfigCommand
from
slapos.cli.config
import
ConfigCommand
...
@@ -76,7 +76,7 @@ def do_lookup(logger, cache_dir, software_url):
...
@@ -76,7 +76,7 @@ def do_lookup(logger, cache_dir, software_url):
pt
=
prettytable
.
PrettyTable
([
'distribution'
,
'version'
,
'id'
,
'compatible?'
])
pt
=
prettytable
.
PrettyTable
([
'distribution'
,
'version'
,
'id'
,
'compatible?'
])
linux_distribution
=
patched_linux_distribution
()
linux_distribution
=
distribution_tuple
()
for
os
in
ostable
:
for
os
in
ostable
:
compatible
=
'yes'
if
networkcache
.
os_matches
(
os
,
linux_distribution
)
else
'no'
compatible
=
'yes'
if
networkcache
.
os_matches
(
os
,
linux_distribution
)
else
'no'
...
...
slapos/grid/distribution.py
View file @
9359dede
...
@@ -13,6 +13,9 @@ patched_linux_distribution(...):
...
@@ -13,6 +13,9 @@ patched_linux_distribution(...):
see http://bugs.python.org/issue9514
see http://bugs.python.org/issue9514
otherwise, Ubuntu will always be reported as an unstable Debian, regardless of the version.
otherwise, Ubuntu will always be reported as an unstable Debian, regardless of the version.
distribution_tuple()
returns a (distname, version, id) tuple under linux or cygwin
"""
"""
import
platform
import
platform
...
@@ -62,3 +65,10 @@ def patched_linux_distribution(distname='', version='', id='',
...
@@ -62,3 +65,10 @@ def patched_linux_distribution(distname='', version='', id='',
pass
pass
return
platform
.
linux_distribution
(
distname
,
version
,
id
,
supported_dists
,
full_distribution_name
)
return
platform
.
linux_distribution
(
distname
,
version
,
id
,
supported_dists
,
full_distribution_name
)
def
distribution_tuple
():
if
platform
.
system
().
startswith
(
'CYGWIN_'
):
return
(
platform
.
system
(),
platform
.
platform
(),
''
)
else
:
return
patched_linux_distribution
()
slapos/grid/networkcache.py
View file @
9359dede
...
@@ -18,7 +18,7 @@ import platform
...
@@ -18,7 +18,7 @@ import platform
import
shutil
import
shutil
import
traceback
import
traceback
from
slapos.grid.distribution
import
os_matches
,
patched_linux_distribution
from
slapos.grid.distribution
import
os_matches
,
distribution_tuple
try
:
try
:
try
:
try
:
...
@@ -88,7 +88,7 @@ def download_network_cached(cache_url, dir_url, software_url, software_root,
...
@@ -88,7 +88,7 @@ def download_network_cached(cache_url, dir_url, software_url, software_root,
if
tags
.
get
(
'machine'
)
!=
platform
.
machine
():
if
tags
.
get
(
'machine'
)
!=
platform
.
machine
():
continue
continue
if
not
os_matches
(
ast
.
literal_eval
(
tags
.
get
(
'os'
)),
if
not
os_matches
(
ast
.
literal_eval
(
tags
.
get
(
'os'
)),
patched_linux_distribution
()):
distribution_tuple
()):
continue
continue
if
tags
.
get
(
'software_url'
)
!=
software_url
:
if
tags
.
get
(
'software_url'
)
!=
software_url
:
continue
continue
...
@@ -134,7 +134,7 @@ def upload_network_cached(software_root, software_url, cached_key,
...
@@ -134,7 +134,7 @@ def upload_network_cached(software_root, software_url, cached_key,
software_url
=
software_url
,
software_url
=
software_url
,
software_root
=
software_root
,
software_root
=
software_root
,
machine
=
platform
.
machine
(),
machine
=
platform
.
machine
(),
os
=
str
(
patched_linux_distribution
())
os
=
str
(
distribution_tuple
())
)
)
f
=
open
(
path
,
'r'
)
f
=
open
(
path
,
'r'
)
...
...
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