From 6e25eff176d68e7390a5954c1d331942428e667d Mon Sep 17 00:00:00 2001 From: david Date: Sun, 24 May 2009 18:59:19 +0000 Subject: [PATCH] Fix a bug I found by reading Daniel Roethlisberger's article at http://www.linux-magazin.de/Heft-Abo/Ausgaben/2009/06/Alles-inklusive/(offset)/4. Don't print a "Not shown: " line if there were no extraports. --- ndiff/ndiff | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ndiff/ndiff b/ndiff/ndiff index ca3014243..c9146fce5 100755 --- a/ndiff/ndiff +++ b/ndiff/ndiff @@ -491,12 +491,13 @@ class HostDiff(object): # Extraports. if self.extraports_changed: - if host_a.state is not None: + if len(host_a.extraports) > 0: print >> f, u"-Not shown: %s" % host_a.extraports_string() - if host_b.state is not None: + if len(host_b.extraports) > 0: print >> f, u"+Not shown: %s" % host_b.extraports_string() elif verbose: - print >> f, u" Not shown: %s" % host_a.extraports_string() + if len(host_a.extraports) > 0: + print >> f, u" Not shown: %s" % host_a.extraports_string() # Port table. port_table = Table(u"** * * *")