Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

cloudstack-setup-databases: get local address instead of 127.0.1.1 #10571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
weizhouapache wants to merge 3 commits into apache:4.19
base: 4.19
Choose a base branch
Loading
from weizhouapache:4.19-fix-cluster-node-ip-127.0.1.1
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
View file Open in desktop
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

AltStyle によって変換されたページ (->オリジナル) /