From dd5108c79899db34729ad9e9bfb3911a4781dd22 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 27 Apr 2011 17:17:35 +0000 Subject: [PATCH] Mit Parsing config weitergemacht git-svn-id: http://svn.brehm-online.com/svn/my-stuff/python/PyLogrotate/trunk@214 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa --- LogRotateConfig.py | 2 +- LogRotateHandler.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/LogRotateConfig.py b/LogRotateConfig.py index b941c58..390d69b 100755 --- a/LogRotateConfig.py +++ b/LogRotateConfig.py @@ -591,7 +591,7 @@ class LogrotateConfigurationReader(object): linenr += 1 line = line.strip() - # Perform a bckslash at the end of the line + # Perform a backslash at the end of the line line = lastrow + line match = re.search(r'\\$', line) if match: diff --git a/LogRotateHandler.py b/LogRotateHandler.py index 0fe4e8f..c9a1224 100755 --- a/LogRotateHandler.py +++ b/LogRotateHandler.py @@ -146,6 +146,12 @@ class LogrotateHandler(object): @type: dict ''' + self.scripts = {} + ''' + @ivar: list of all named scripts found in configuration + @type: list + ''' + ################################################# # Create a logger object self.logger = logging.getLogger('pylogrotate') @@ -200,6 +206,7 @@ class LogrotateHandler(object): 'force': self.force, 'local_dir': self.local_dir, 'mail_cmd': self.mail_cmd, + 'scripts': self.scripts, 'state_file': self.state_file, 'test': self.test, 'verbose': self.verbose, @@ -229,7 +236,8 @@ class LogrotateHandler(object): + ':\n' + str(config_reader) ) try: - self.config = config_reader.get_config() + self.config = config_reader.get_config() + self.scripts = config_reader.get_scripts() except LogrotateConfigurationError, e: self.logger.error( str(e) ) sys.exit(10) -- 2.39.5