Commit 4d67c5a4 authored by Łukasz Nowak's avatar Łukasz Nowak

Do nothing in case if log rotation is not enabled.

parent 0cc173a7
......@@ -146,11 +146,15 @@ class Recipe(BaseSlapRecipe):
def registerLogRotation(self, name, log_file_list, postrotate_script):
"""Register new log rotation requirement"""
open(os.path.join(self.logrotate_d, name), 'w').write(
if getattr(self, 'logrotate_d', None) is not None:
open(os.path.join(self.logrotate_d, name), 'w').write(
dict(file_list=' '.join(['"'+q+'"' for q in log_file_list]),
postrotate=postrotate_script, olddir=self.logrotate_backup)))
self.logger.warning('No log rotation configured for %r, as log rotate '
'is not configured' % name)
def linkBinary(self):
"""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