From 8a024bfb5e488eb11ce6e5633f1724848f1cf215 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 2 Dec 2010 18:28:32 +0000 Subject: [PATCH] Marginales Zeug git-svn-id: http://svn.brehm-online.com/svn/my-stuff/nagios/trunk@137 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa --- bin/nagios/config.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/nagios/config.py b/bin/nagios/config.py index a2ad464..ba5e8d2 100644 --- a/bin/nagios/config.py +++ b/bin/nagios/config.py @@ -55,11 +55,6 @@ class NagiosConfig(object): #------------------------------------------------------ def __init__( self, new_file = file_name ): "Konstruktor." - self.file_name = self.canonize_file(new_file) - self.conf = {} - self.objects = {} - self.config_objects = {} - self.objects_read = {} # Logging-Setup self.logger = logging.getLogger('nagiosConfig') @@ -73,6 +68,12 @@ class NagiosConfig(object): self.logger.addHandler(ch) + self.file_name = self.canonize_file(new_file) + self.conf = {} + self.objects = {} + self.config_objects = {} + self.objects_read = {} + #------------------------------------------------------ def __del__( self ): "Destruktor" @@ -98,6 +99,8 @@ class NagiosConfig(object): def search_conf( self, f = None ): "Sucht die Nagios-Konfigurationsdatei und speichert diese in self.file_name bzw. stirbt, wenn nicht gefunden." + self.logger.debug( "Searching for main configuration file ..." ) + if f is None: f = self.file_name if os.path.exists(f): if os.path.isfile(f): @@ -116,6 +119,7 @@ class NagiosConfig(object): #print repr(search_dirs) for path in search_dirs: + self.logger.debug( "Searching for main configuration file in directory {0!r}.".format( path ) ) if not ( os.path.exists(path) and os.path.isdir(path) ): continue if path in used_dirs: continue -- 2.39.5