From 7801d32ec444a175ef5bf1beedff48b37df2aea2 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Thu, 18 Feb 2010 19:17:56 +0000 Subject: Properly handle log retention --- src/msec/plugins/log.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/msec/plugins/log.py b/src/msec/plugins/log.py index 8f11e72..2749263 100644 --- a/src/msec/plugins/log.py +++ b/src/msec/plugins/log.py @@ -42,13 +42,13 @@ class log: try: retention = int(arg) except: - self.log.error(_('Invalid maximum password history length: "%s"') % arg) + self.log.error(_('Invalid retention period: "%s"') % arg) return logrotate = self.configfiles.get_config_file(self.LOGROTATE) - val = logrotate.get_match(self.LOGROTATE_ROTATE) + val = logrotate.get_match(self.LOGROTATE_ROTATE, '@1') - if val != retention: + if val != arg: self.log.info(_("Setting log retention period to %d weeks") % retention) logrotate.replace_line_matching(self.LOGROTATE_ROTATE, ("rotate %d" % retention)) -- cgit v1.2.1