Skip to content

Commit

Permalink
Merge pull request #37 from Vatson112/fix-add_host_supersede
Browse files Browse the repository at this point in the history
Fix TypeError: a bytes-like object is required, not 'str'
  • Loading branch information
cygnusb authored Oct 21, 2021
2 parents 1319a33 + e34c2b6 commit 03b27e9
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 @@ -1311,7 +1311,7 @@ def add_host_supersede(self, ip, mac, name, hostname=None, router=None, domain=N

msg = OmapiMessage.open(b"host")
msg.message.append((b"create", struct.pack("!I", 1)))
msg.obj.append((b"name", name))
msg.obj.append((b"name", name.encode('utf-8')))
msg.obj.append((b"hardware-address", pack_mac(mac)))
msg.obj.append((b"hardware-type", struct.pack("!I", 1)))
msg.obj.append((b"ip-address", pack_ip(ip)))
Expand Down

0 comments on commit 03b27e9

Please sign in to comment.