Commit 4d3f3c36 authored by Marco Mariani's avatar Marco Mariani

create and run $MD5/buildout.cfg

parent 56098812
...@@ -37,6 +37,7 @@ import pwd ...@@ -37,6 +37,7 @@ import pwd
import stat import stat
import tarfile import tarfile
import tempfile import tempfile
import textwrap
import utils import utils
import xmlrpclib import xmlrpclib
...@@ -169,7 +170,10 @@ class Software(object): ...@@ -169,7 +170,10 @@ class Software(object):
buildout_parameter_list.append( \ buildout_parameter_list.append( \
buildout_option % ('networkcache:', value)) buildout_option % ('networkcache:', value))
buildout_parameter_list.extend(['-c', self.url]) buildout_cfg = os.path.join(self.software_path, 'buildout.cfg')
self.createProfileIfMissing(buildout_cfg, self.url)
buildout_parameter_list.extend(['-c', buildout_cfg])
utils.bootstrapBuildout(self.software_path, self.buildout, utils.bootstrapBuildout(self.software_path, self.buildout,
additional_buildout_parametr_list=buildout_parameter_list) additional_buildout_parametr_list=buildout_parameter_list)
utils.launchBuildout(self.software_path, utils.launchBuildout(self.software_path,
...@@ -178,6 +182,19 @@ class Software(object): ...@@ -178,6 +182,19 @@ class Software(object):
finally: finally:
shutil.rmtree(extends_cache) shutil.rmtree(extends_cache)
def createProfileIfMissing(self, buildout_cfg, url):
root_stat_info = os.stat(self.software_root)
if not os.path.exists(buildout_cfg):
with open(buildout_cfg, 'wb') as fout:
fout.write(textwrap.dedent("""\
# Created by slapgrid. extends {url}
# but you can change it for development purposes.
[buildout]
extends = {url}
""".format(url=url)))
os.chown(buildout_cfg, root_stat_info.st_uid, root_stat_info.st_gid)
def uploadSoftwareRelease(self, tarpath): def uploadSoftwareRelease(self, tarpath):
""" """
Try to tar and upload an installed Software Release. Try to tar and upload an installed Software Release.
......
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