Skip to content

Commit

Permalink
another py3 thing
Browse files Browse the repository at this point in the history
  • Loading branch information
EarthmanT committed Oct 8, 2023
1 parent cf27362 commit cc25a1f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cloudify_docker/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ def get_interface_ip(ifname):
return socket.inet_ntoa(fcntl.ioctl(
s.fileno(),
0x8915, # SIOCGIFADDR
struct.pack('256s', bytes(ifname[:15]))
# Python 3: add 'utf-8' to bytes
struct.pack('256s', bytes(ifname[:15], encoding='utf8'))
)[20:24])
return "127.0.0.1"

Expand Down

0 comments on commit cc25a1f

Please sign in to comment.