Commit 37f2aea5 authored by Xavier Thompson's avatar Xavier Thompson

slapgrid: Map instances to their installed python

parent 1809c9d1
......@@ -472,6 +472,8 @@ class Partition(object):
self.instance_min_free_space = instance_min_free_space
self.instance_python = self.getInstalledPythonExecutable()
def check_free_space(self):
required = self.instance_min_free_space or 0
......@@ -705,6 +707,7 @@ class Partition(object):
debug=self.buildout_debug)
self.generateSupervisorConfigurationFile()
self.createRetentionLockDelay()
self.instance_python = self.getInstalledPythonExecutable()
def generateSupervisorConfiguration(self):
"""
......@@ -1043,3 +1046,14 @@ class Partition(object):
return float(date_file_path.read())
else:
return None
def getInstalledPythonExecutable(self):
"""
Return the path of the python executable installed for the SR of this instance.
"""
installed_cfg = ConfigParser()
installed_cfg.read(os.path.join(self.software_path, '.installed.cfg'))
try:
return installed_cfg.get('python', 'executable')
except Exception:
return None
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