Skip to content

Commit

Permalink
Fix for underscore to dash conversion
Browse files Browse the repository at this point in the history
DHCP OMAPI normally uses dashes as a separator for field words. Python does not accept dashes in kwarg keys, so there is a conversion in the __lookup function to convert _ to -. However, there seems to be a bug that prevents that conversion to be actually used for some parameters.
  • Loading branch information
mrd000 authored Jul 1, 2020
1 parent 3705674 commit 33237cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pypureomapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ def __lookup(self, ltype, **kwargs):
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')))
msg.obj.append((str(_k).encode(), kwargs[k].encode('utf-8')))
response = self.query_server(msg)
if response.opcode != OMAPI_OP_UPDATE:
raise OmapiErrorNotFound()
Expand Down

0 comments on commit 33237cd

Please sign in to comment.