Commit ede11c8e authored by Marco Mariani's avatar Marco Mariani

getSoftwareUrlHash -> md5digest

parent 0ad51d3d
......@@ -41,7 +41,7 @@ import textwrap
import xmlrpclib
from supervisor import xmlrpc
from slapos.grid.utils import (getSoftwareUrlHash, getCleanEnvironment, bootstrapBuildout,
from slapos.grid.utils import (md5digest, getCleanEnvironment, bootstrapBuildout,
launchBuildout, SlapPopen, dropPrivileges, updateFile)
from slapos.slap.slap import NotFoundError
from slapos.grid.svcbackend import getSupervisorRPC
......@@ -68,7 +68,7 @@ class Software(object):
"""
self.url = url
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_url_hash)
self.buildout = buildout
......
......@@ -55,7 +55,7 @@ from slapos.grid.exception import BuildoutFailedError
from slapos.grid.SlapObject import Software, Partition, WrongPermissionError, \
PathDoesNotExistError
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)
import slapos.slap
......@@ -740,7 +740,7 @@ class Slapgrid(object):
software_url = None
try:
software_path = os.path.join(self.software_root,
getSoftwareUrlHash(software_url))
md5digest(software_url))
except TypeError:
# Problem with instance: SR URI not set.
# Try to process it anyway, it may need to be deleted.
......@@ -1241,7 +1241,7 @@ class Slapgrid(object):
try:
software_url = computer_partition.getSoftwareRelease().getURI()
software_path = os.path.join(self.software_root,
getSoftwareUrlHash(software_url))
md5digest(software_url))
except (NotFoundError, TypeError):
software_url = None
software_path = None
......
......@@ -115,7 +115,7 @@ class SlapPopen(subprocess.Popen):
logger.info(line)
self.output = ''.join(output_lines)
def getSoftwareUrlHash(url):
def md5digest(url):
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