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
Eric Zheng
slapos.core
Commits
a80b52a4
Commit
a80b52a4
authored
Jan 18, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'networkcache-debian'
parents
b5f2cfb8
1628248d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
CHANGES.txt
CHANGES.txt
+1
-0
slapos/grid/networkcache.py
slapos/grid/networkcache.py
+17
-3
No files found.
CHANGES.txt
View file @
a80b52a4
...
...
@@ -4,6 +4,7 @@ Changes
0.33.2 (unreleased)
-------------------
* networkcache: only match major release number in debian [Marco Mariani]
* slapproxy: Filter by instance_guid, allow computer partition renames
and change of software_type and requested_state [Marco Mariani]
* slapproxy: Stop instance even if buildout/reporting is wrong [Cedric de Saint Martin]
...
...
slapos/grid/networkcache.py
View file @
a80b52a4
...
...
@@ -12,10 +12,11 @@
#
##############################################################################
import
shutil
import
traceback
import
ast
import
json
import
platform
import
shutil
import
traceback
try
:
try
:
...
...
@@ -47,6 +48,18 @@ def fallback_call(function):
return
wrapper
def
debianize
(
os
):
# keep only the major release number in case of debian
distname
,
version
,
id_
=
os
if
distname
==
'debian'
and
'.'
in
version
:
version
=
version
.
split
(
'.'
)[
0
]
return
distname
,
version
,
id_
def
os_matches
(
os1
,
os2
):
return
debianize
(
os1
)
==
debianize
(
os2
)
@
fallback_call
def
download_network_cached
(
cache_url
,
dir_url
,
software_url
,
software_root
,
key
,
path
,
logger
,
signature_certificate_list
,
...
...
@@ -85,7 +98,8 @@ def download_network_cached(cache_url, dir_url, software_url, software_root,
tags
=
json
.
loads
(
json_information
)
if
tags
.
get
(
'machine'
)
!=
platform
.
machine
():
continue
if
tags
.
get
(
'os'
)
!=
str
(
platform
.
linux_distribution
()):
if
not
os_matches
(
ast
.
literal_eval
(
tags
.
get
(
'os'
)),
platform
.
linux_distribution
()):
continue
if
tags
.
get
(
'software_url'
)
!=
software_url
:
continue
...
...
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