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
Xavier Thompson
slapos.core
Commits
ede11c8e
Commit
ede11c8e
authored
Apr 25, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getSoftwareUrlHash -> md5digest
parent
0ad51d3d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+2
-2
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+3
-3
slapos/grid/utils.py
slapos/grid/utils.py
+1
-1
No files found.
slapos/grid/SlapObject.py
View file @
ede11c8e
...
@@ -41,7 +41,7 @@ import textwrap
...
@@ -41,7 +41,7 @@ import textwrap
import
xmlrpclib
import
xmlrpclib
from
supervisor
import
xmlrpc
from
supervisor
import
xmlrpc
from
slapos.grid.utils
import
(
getSoftwareUrlHash
,
getCleanEnvironment
,
bootstrapBuildout
,
from
slapos.grid.utils
import
(
md5digest
,
getCleanEnvironment
,
bootstrapBuildout
,
launchBuildout
,
SlapPopen
,
dropPrivileges
,
updateFile
)
launchBuildout
,
SlapPopen
,
dropPrivileges
,
updateFile
)
from
slapos.slap.slap
import
NotFoundError
from
slapos.slap.slap
import
NotFoundError
from
slapos.grid.svcbackend
import
getSupervisorRPC
from
slapos.grid.svcbackend
import
getSupervisorRPC
...
@@ -68,7 +68,7 @@ class Software(object):
...
@@ -68,7 +68,7 @@ class Software(object):
"""
"""
self
.
url
=
url
self
.
url
=
url
self
.
software_root
=
software_root
self
.
software_root
=
software_root
self
.
software_url_hash
=
getSoftwareUrlHash
(
self
.
url
)
self
.
software_url_hash
=
md5digest
(
self
.
url
)
self
.
software_path
=
os
.
path
.
join
(
self
.
software_root
,
self
.
software_path
=
os
.
path
.
join
(
self
.
software_root
,
self
.
software_url_hash
)
self
.
software_url_hash
)
self
.
buildout
=
buildout
self
.
buildout
=
buildout
...
...
slapos/grid/slapgrid.py
View file @
ede11c8e
...
@@ -55,7 +55,7 @@ from slapos.grid.exception import BuildoutFailedError
...
@@ -55,7 +55,7 @@ from slapos.grid.exception import BuildoutFailedError
from
slapos.grid.SlapObject
import
Software
,
Partition
,
WrongPermissionError
,
\
from
slapos.grid.SlapObject
import
Software
,
Partition
,
WrongPermissionError
,
\
PathDoesNotExistError
PathDoesNotExistError
from
slapos.grid.svcbackend
import
launchSupervisord
from
slapos.grid.svcbackend
import
launchSupervisord
from
slapos.grid.utils
import
(
getSoftwareUrlHash
,
createPrivateDirectory
,
dropPrivileges
,
from
slapos.grid.utils
import
(
md5digest
,
createPrivateDirectory
,
dropPrivileges
,
setRunning
,
setFinished
,
SlapPopen
,
updateFile
)
setRunning
,
setFinished
,
SlapPopen
,
updateFile
)
import
slapos.slap
import
slapos.slap
...
@@ -740,7 +740,7 @@ class Slapgrid(object):
...
@@ -740,7 +740,7 @@ class Slapgrid(object):
software_url
=
None
software_url
=
None
try
:
try
:
software_path
=
os
.
path
.
join
(
self
.
software_root
,
software_path
=
os
.
path
.
join
(
self
.
software_root
,
getSoftwareUrlHash
(
software_url
))
md5digest
(
software_url
))
except
TypeError
:
except
TypeError
:
# Problem with instance: SR URI not set.
# Problem with instance: SR URI not set.
# Try to process it anyway, it may need to be deleted.
# Try to process it anyway, it may need to be deleted.
...
@@ -1241,7 +1241,7 @@ class Slapgrid(object):
...
@@ -1241,7 +1241,7 @@ class Slapgrid(object):
try
:
try
:
software_url
=
computer_partition
.
getSoftwareRelease
().
getURI
()
software_url
=
computer_partition
.
getSoftwareRelease
().
getURI
()
software_path
=
os
.
path
.
join
(
self
.
software_root
,
software_path
=
os
.
path
.
join
(
self
.
software_root
,
getSoftwareUrlHash
(
software_url
))
md5digest
(
software_url
))
except
(
NotFoundError
,
TypeError
):
except
(
NotFoundError
,
TypeError
):
software_url
=
None
software_url
=
None
software_path
=
None
software_path
=
None
...
...
slapos/grid/utils.py
View file @
ede11c8e
...
@@ -115,7 +115,7 @@ class SlapPopen(subprocess.Popen):
...
@@ -115,7 +115,7 @@ class SlapPopen(subprocess.Popen):
logger
.
info
(
line
)
logger
.
info
(
line
)
self
.
output
=
''
.
join
(
output_lines
)
self
.
output
=
''
.
join
(
output_lines
)
def
getSoftwareUrlHash
(
url
):
def
md5digest
(
url
):
return
md5
(
url
).
hexdigest
()
return
md5
(
url
).
hexdigest
()
...
...
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