Commit 9ae2ba0f authored by Łukasz Nowak's avatar Łukasz Nowak

Revert "Do nothing in case if log rotation is not enabled."

This reverts commit 4d67c5a4.

It is not safe to have fallback in administration, and log rotation is
always nice feature.
parent 4d67c5a4
...@@ -146,15 +146,11 @@ class Recipe(BaseSlapRecipe): ...@@ -146,15 +146,11 @@ class Recipe(BaseSlapRecipe):
def registerLogRotation(self, name, log_file_list, postrotate_script): def registerLogRotation(self, name, log_file_list, postrotate_script):
"""Register new log rotation requirement""" """Register new log rotation requirement"""
if getattr(self, 'logrotate_d', None) is not None: open(os.path.join(self.logrotate_d, name), 'w').write(
open(os.path.join(self.logrotate_d, name), 'w').write(
self.substituteTemplate(self.getTemplateFilename( self.substituteTemplate(self.getTemplateFilename(
'logrotate_entry.in'), 'logrotate_entry.in'),
dict(file_list=' '.join(['"'+q+'"' for q in log_file_list]), dict(file_list=' '.join(['"'+q+'"' for q in log_file_list]),
postrotate=postrotate_script, olddir=self.logrotate_backup))) postrotate=postrotate_script, olddir=self.logrotate_backup)))
else:
self.logger.warning('No log rotation configured for %r, as log rotate '
'is not configured' % name)
def linkBinary(self): def linkBinary(self):
"""Links binaries to instance's bin directory for easier exposal""" """Links binaries to instance's bin directory for easier exposal"""
......
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