Commit 0089b24a authored by Łukasz Nowak's avatar Łukasz Nowak

Provide backward compatiblity for old style method.

Thanks to partially reverting "Use only externally provided buildout."
(commit 2a0bbcc9) it is possible to use
slapgrid with provided buildout binary, but no one is forced to follow this
way, as old style internal bootstraping procedure is available.

Conflicts, manually merged:

	slapos/grid/slapgrid.py
	slapos/grid/utils.py
parent 54d4ac94
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
import logging import logging
import hashlib import hashlib
import os import os
import pkg_resources
import stat import stat
import subprocess import subprocess
import sys import sys
...@@ -216,8 +217,8 @@ def dropPrivileges(uid, gid): ...@@ -216,8 +217,8 @@ def dropPrivileges(uid, gid):
logger.info('Succesfully dropped privileges to uid=%r gid=%r' % (uid, gid)) logger.info('Succesfully dropped privileges to uid=%r gid=%r' % (uid, gid))
def bootstrapBuildout(path, buildout, additional_buildout_parametr_list=None, def bootstrapBuildout(path, buildout=None,
console=False): additional_buildout_parametr_list=None, console=False):
if additional_buildout_parametr_list is None: if additional_buildout_parametr_list is None:
additional_buildout_parametr_list = [] additional_buildout_parametr_list = []
logger = logging.getLogger('BuildoutManager') logger = logging.getLogger('BuildoutManager')
...@@ -227,7 +228,13 @@ def bootstrapBuildout(path, buildout, additional_buildout_parametr_list=None, ...@@ -227,7 +228,13 @@ def bootstrapBuildout(path, buildout, additional_buildout_parametr_list=None,
gid = stat_info.st_gid gid = stat_info.st_gid
invocation_list = [sys.executable, '-S'] invocation_list = [sys.executable, '-S']
invocation_list.append(buildout) if buildout is not None:
invocation_list.append(buildout)
else:
logger.warning('Using old style bootstrap of included bootstrap file. '
'Consider setting buildout binary location.')
invocation_list.append(pkg_resources.resource_filename(__name__,
'zc.buildout-bootstap.py'))
invocation_list.extend(additional_buildout_parametr_list) invocation_list.extend(additional_buildout_parametr_list)
invocation_list.append('bootstrap') invocation_list.append('bootstrap')
try: try:
......
This diff is collapsed.
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