Fixed error handling in dhcpdump.py
This commit is contained in:
parent
7da2da06e2
commit
edbd519dc0
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue