Commit ede11c8e authored by Marco Mariani's avatar Marco Mariani

getSoftwareUrlHash -> md5digest

parent 0ad51d3d
...@@ -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
......
...@@ -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
......
...@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment