Commit 35b6fef4 authored by Łukasz Nowak's avatar Łukasz Nowak

- install and expose self.cron_d to register cron tasks by recipe


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44930 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 21b665cd
...@@ -52,6 +52,8 @@ class Recipe(BaseSlapRecipe): ...@@ -52,6 +52,8 @@ class Recipe(BaseSlapRecipe):
def _install(self): def _install(self):
self.path_list = [] self.path_list = []
self.requirements, self.ws = self.egg.working_set([__name__]) self.requirements, self.ws = self.egg.working_set([__name__])
# self.cron_d is a directory, where cron jobs can be registered
self.cron_d = self.installCrond()
ca_conf = self.installCertificateAuthority() ca_conf = self.installCertificateAuthority()
memcached_conf = self.installMemcached(ip=self.getLocalIPv4Address(), memcached_conf = self.installMemcached(ip=self.getLocalIPv4Address(),
port=11000) port=11000)
...@@ -194,6 +196,22 @@ class Recipe(BaseSlapRecipe): ...@@ -194,6 +196,22 @@ class Recipe(BaseSlapRecipe):
)])[0] )])[0]
self.path_list.append(runUnitTest) self.path_list.append(runUnitTest)
def installCrond(self):
timestamps = self.createDataDirectory('cronstamps')
cron_d = os.path.join(self.var_directory, 'cron.d')
crontabs = os.path.join(self.var_directory, 'crontabs')
logfile = os.path.join(self.log_directory, 'cron.log')
self._createDirectory(cron_d)
self._createDirectory(crontabs)
wrapper = zc.buildout.easy_install.scripts([('crond',
__name__ + '.execute', 'execute')], self.ws, sys.executable,
self.wrapper_directory, arguments=[
self.options['dcrond_binary'].strip(), '-s', cron_d, '-c', crontabs,
'-t', timestamps, '-L', logfile, '-f', '-l', '10']
)[0]
self.path_list.append(wrapper)
return cron_d
def installCertificateAuthority(self, ca_country_code='XX', def installCertificateAuthority(self, ca_country_code='XX',
ca_email='xx@example.com', ca_state='State', ca_city='City', ca_email='xx@example.com', ca_state='State', ca_city='City',
ca_company='Company'): ca_company='Company'):
......
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