Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions setup/bindir/cloud-setup-databases.in
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,11 @@ for example:
def grabSystemInfo(self):
def getIpAddr():
try:
ip = socket.gethostbyname(socket.gethostname())
return ip
hostname, aliases, addresses = socket.gethostbyname_ex(socket.gethostname())
for address in addresses:
if address != "127.0.0.1" and address != "127.0.1.1":
return address
return "127.0.0.1"
Comment on lines +331 to +335
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded IP address strings should be replaced with constants or use the ipaddress module for better maintainability. Consider using ipaddress.ip_address(address).is_loopback to check for all loopback addresses, not just the two specific ones.

Copilot uses AI. Check for mistakes.

except Exception as e:
return "127.0.0.1"

Expand Down
Loading