From edbd519dc0b3fa6db1b12f74590a10f500988a33 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Wed, 8 Jun 2011 14:21:47 +0300 Subject: [PATCH] Fixed error handling in dhcpdump.py --- dhcp/files/dhcpdump.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhcp/files/dhcpdump.py b/dhcp/files/dhcpdump.py index 4493269..d4506ba 100755 --- a/dhcp/files/dhcpdump.py +++ b/dhcp/files/dhcpdump.py @@ -24,7 +24,7 @@ def main(): def ldapsearch(filter): - p = Popen(['ldapsearch', '-x', '-LLL', filter, 'cn', 'macAddress', 'ipHostNumber'], + p = Popen(['ldapsearch', '-x', '-z', '0', '-LLL', filter, 'cn', 'macAddress', 'ipHostNumber'], bufsize=1024, stdout=PIPE, close_fds=True) ret = [] cur = {} @@ -35,7 +35,7 @@ def ldapsearch(filter): ret.append('host %s { option host-name "%s"; hardware ethernet %s; fixed-address %s; }' % ( cur["cn"], cur["cn"].split('.')[0], cur["macAddress"], cur["ipHostNumber"])) except KeyError: - print "foo" + print >>sys.stderr, "skipping: %s" % repr(cur) cur = {} continue l = l.split()