From: Sven Velt Date: Tue, 23 Feb 2010 15:10:27 +0000 (+0100) Subject: Small fix if run in "checkresult" mode X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9143ca7443a01a28304a1471af4436ae2bc6f630;p=nagixsc.git Small fix if run in "checkresult" mode Signed-off-by: Sven Velt --- diff --git a/nagixsc_xml2nagios.py b/nagixsc_xml2nagios.py index 96b6a52..f16c8a8 100755 --- a/nagixsc_xml2nagios.py +++ b/nagixsc_xml2nagios.py @@ -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)