Skip to content

Commit

Permalink
Fix lookup on omapi DHCP type parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusb committed Feb 11, 2019
1 parent d820b3d commit b40d3e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pypureomapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1242,13 +1242,13 @@ def __lookup(self, ltype, **kwargs):
assert ltype_utf in [b"host", b"lease"]
msg = OmapiMessage.open(ltype_utf)
for k in kwargs:
k.replace("_", "-")
if k in ["ip", "ip-address"]:
_k = k.replace("_", "-")
if _k in ["ip", "ip-address"]:
msg.obj.append((b"ip-address", pack_ip(kwargs[k])))
elif k in ["mac", "hardware-address"]:
elif _k in ["mac", "hardware-address"]:
msg.obj.append((b"hardware-address", pack_mac(kwargs[k])))
msg.obj.append((b"hardware-type", struct.pack("!I", 1)))
elif k == "name":
elif _k == "name":
msg.obj.append((b"name", kwargs[k].encode('utf-8')))
else:
msg.obj.append((str(k).encode(), kwargs[k].encode('utf-8')))
Expand Down

0 comments on commit b40d3e1

Please sign in to comment.