Code

Small fix if run in "checkresult" mode
authorSven Velt <sven@velt.de>
Tue, 23 Feb 2010 15:10:27 +0000 (16:10 +0100)
committerSven Velt <sven@velt.de>
Tue, 23 Feb 2010 15:10:27 +0000 (16:10 +0100)
Signed-off-by: Sven Velt <sven@velt.de>
nagixsc_xml2nagios.py

index 96b6a522b6090c3e9055c2ef7fca84b92b82cf54..f16c8a832278d51d6786d4df13e10267d9df4094 100755 (executable)
@@ -160,9 +160,10 @@ if options.mode == 'passive' or options.mode == 'passive_check':
 elif options.mode.startswith('checkresult'):
        (count_services, count_failed, list_failed) = dict2out_checkresult(checks, xml_get_timestamp(doc), options.checkresultdir, options.verb)
 
-       if list_failed and options.mode == 'checkresult':
-               for entry in list_failed:
-                       print 'Could not write checkresult files "%s(.ok)" for "%s"/"%s"!' % (entry[0], entry[1], entry[2])
+       if options.mode == 'checkresult':
+               if list_failed:
+                       for entry in list_failed:
+                               print 'Could not write checkresult files "%s(.ok)" for "%s"/"%s"!' % (entry[0], entry[1], entry[2])
 
                if count_failed == 0:
                        sys.exit(0)