Commit d3aa0a7c authored by Łukasz Nowak's avatar Łukasz Nowak

Use temporary extends-cache during software setup.

parent e6732346
0.5 (unreleased) 0.5 (unreleased)
================ ================
* No changes yet. * slapgrid: Use temporary extends-cache directory in order to make faster
remote profile refresh. [Łukasz Nowak]
0.4 (2011-06-24) 0.4 (2011-06-24)
================ ================
......
...@@ -29,7 +29,9 @@ import os ...@@ -29,7 +29,9 @@ import os
import shutil import shutil
import subprocess import subprocess
import pkg_resources import pkg_resources
import shutil
import stat import stat
import tempfile
from supervisor import xmlrpc from supervisor import xmlrpc
import xmlrpclib import xmlrpclib
import pwd import pwd
...@@ -72,7 +74,10 @@ class Software(object): ...@@ -72,7 +74,10 @@ class Software(object):
root_stat_info.st_gid != path_stat_info.st_gid: root_stat_info.st_gid != path_stat_info.st_gid:
os.chown(path, root_stat_info.st_uid, os.chown(path, root_stat_info.st_uid,
root_stat_info.st_gid) root_stat_info.st_gid)
extends_cache = tempfile.mkdtemp()
try:
buildout_parameter_list = [ buildout_parameter_list = [
'buildout:extends-cache=%s' % extends_cache,
'buildout:directory=%s' % self.software_path, 'buildout:directory=%s' % self.software_path,
'-c', self.url] '-c', self.url]
bootstrapBuildout(self.software_path, self.buildout, bootstrapBuildout(self.software_path, self.buildout,
...@@ -82,6 +87,8 @@ class Software(object): ...@@ -82,6 +87,8 @@ class Software(object):
os.path.join(self.software_path, 'bin', 'buildout'), os.path.join(self.software_path, 'bin', 'buildout'),
additional_buildout_parametr_list=buildout_parameter_list, additional_buildout_parametr_list=buildout_parameter_list,
console=self.console) console=self.console)
finally:
shutil.rmtree(extends_cache)
def remove(self): def remove(self):
"""Removes the part that was installed. """Removes the part that was installed.
......
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