Commit e5420582 authored by Marco Mariani's avatar Marco Mariani

call mockable functions through utils.

parent 2d608b65
...@@ -42,8 +42,9 @@ import xmlrpclib ...@@ -42,8 +42,9 @@ import xmlrpclib
from supervisor import xmlrpc from supervisor import xmlrpc
from slapos.grid.utils import (md5digest, getCleanEnvironment, bootstrapBuildout, from slapos.grid.utils import (md5digest, getCleanEnvironment,
launchBuildout, SlapPopen, dropPrivileges, updateFile) SlapPopen, dropPrivileges, updateFile)
from slapos.grid import utils # for mocked methods
from slapos.slap.slap import NotFoundError from slapos.slap.slap import NotFoundError
from slapos.grid.svcbackend import getSupervisorRPC from slapos.grid.svcbackend import getSupervisorRPC
from slapos.grid.exception import (BuildoutFailedError, WrongPermissionError, from slapos.grid.exception import (BuildoutFailedError, WrongPermissionError,
...@@ -176,9 +177,9 @@ class Software(object): ...@@ -176,9 +177,9 @@ class Software(object):
self.createProfileIfMissing(buildout_cfg, self.url) self.createProfileIfMissing(buildout_cfg, self.url)
buildout_parameter_list.extend(['-c', buildout_cfg]) buildout_parameter_list.extend(['-c', buildout_cfg])
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)
launchBuildout(self.software_path, utils.launchBuildout(self.software_path,
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)
finally: finally:
...@@ -429,11 +430,11 @@ class Partition(object): ...@@ -429,11 +430,11 @@ class Partition(object):
if not os.path.exists(buildout_binary): if not os.path.exists(buildout_binary):
# use own buildout generation # use own buildout generation
bootstrapBuildout(self.instance_path, self.buildout, utils.bootstrapBuildout(self.instance_path, self.buildout,
['buildout:bin-directory=%s' % os.path.join(self.instance_path, 'sbin')]) ['buildout:bin-directory=%s' % os.path.join(self.instance_path, 'sbin')])
buildout_binary = os.path.join(self.instance_path, 'sbin', 'buildout') buildout_binary = os.path.join(self.instance_path, 'sbin', 'buildout')
# Launches buildout # Launches buildout
launchBuildout(self.instance_path, buildout_binary) utils.launchBuildout(self.instance_path, buildout_binary)
# Generates supervisord configuration file from template # Generates supervisord configuration file from template
self.logger.info("Generating supervisord config file from template...") self.logger.info("Generating supervisord config file from template...")
# check if CP/etc/run exists and it is a directory # check if CP/etc/run exists and it is a directory
......
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