]> Frank Brehm's Git Trees - my-stuff/nagios.git/commitdiff
Weitergekommen
authorFrank Brehm <frank@brehm-online.com>
Tue, 14 Dec 2010 23:16:27 +0000 (23:16 +0000)
committerFrank Brehm <frank@brehm-online.com>
Tue, 14 Dec 2010 23:16:27 +0000 (23:16 +0000)
git-svn-id: http://svn.brehm-online.com/svn/my-stuff/nagios/trunk@158 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa

bin/nagios/config.py

index 934dbc622c49a6cc52509a601d85e6e7f5201667..008462064c7bc6549ee0f532e77b978c79eac72c 100644 (file)
@@ -355,7 +355,9 @@ class NagiosConfig(LoggingObject):
         file    = object['use'][1]
         row_num = object['use'][2]
 
+        pp = pprint.PrettyPrinter( indent = 4, depth = 6, width = 120 )
         if 'templates' in object:
+            self.logger.debug( "Templates allready found, returning:\n\t{0}".format( pp.pformat( object['templates'] ) ) )
             return object['templates']
 
         object['templates'] = []
@@ -370,12 +372,14 @@ class NagiosConfig(LoggingObject):
             for name in self._retrieve_templates( object_type, template_name ):
                 names.append( name )
             for name in names:
+                self.logger.debug( "Assigning template {0!r}.".format( name ) )
                 if name in object['templates_applied']:
                     self.logger.debug( "Template {0!r} for {1!r} allready applied.".format( name, object_type ) )
                 else:
                     object['templates'].append( name )
                     object['templates_applied'].add( name )
-            
+
+        self.logger.debug( "Templates returning:\n\t{0}".format( pp.pformat( object['templates'] ) ) )
         return object['templates']
 
     #------------------------------------------------------