Skip to content

Commit 3efd24b

Browse files
committed
Update PR10571
1 parent 2662986 commit 3efd24b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

setup/bindir/cloud-setup-databases.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,11 @@ for example:
328328
def grabSystemInfo(self):
329329
def getIpAddr():
330330
try:
331-
ip = socket.gethostbyname(socket.gethostname())
332-
return ip
331+
hostname, aliases, addresses = socket.gethostbyname_ex(socket.gethostname())
332+
for address in addresses:
333+
if address != "127.0.0.1" and address != "127.0.1.1":
334+
return address
335+
return "127.0.0.1"
333336
except Exception as e:
334337
return "127.0.0.1"
335338

0 commit comments

Comments
 (0)