Skip to content

json-create supports hostnames node config #350

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

Merged
merged 2 commits into from
Jul 15, 2025
Merged
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
21 changes: 12 additions & 9 deletions cli/scripts/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
import sys
import getpass
from tabulate import tabulate # type: ignore
from ipaddress import ip_address
import socket
import os
import re


BASE_DIR = "cluster"
DEFAULT_REPO = "https://pgedge-download.s3.amazonaws.com/REPO"

Expand Down Expand Up @@ -1042,12 +1043,14 @@ def get_cluster_info(cluster_name):
)
try:
if public_ip:
ip_address(public_ip)
socket.gethostbyname(public_ip)

if private_ip:
ip_address(private_ip)
except ValueError:
socket.gethostbyname(private_ip)

except socket.gaierror as e:
validation_errors.append(
f"Invalid IP address provided for node {node.get('name')}."
f"Error resolving hostname or ip adress for node {node.get('name')} : {e}."
)

for sub_node in node.get("sub_nodes", []):
Expand Down Expand Up @@ -1077,12 +1080,12 @@ def get_cluster_info(cluster_name):
)
try:
if public_ip:
ip_address(public_ip)
socket.gethostbyname(public_ip)
if private_ip:
ip_address(private_ip)
except ValueError:
socket.gethostbyname(private_ip)
except socket.gaierror as e:
validation_errors.append(
f"Invalid IP address provided for sub-node {sub_node.get('name')}."
f"Error resolving hostname or ip adress for sub-node {sub_node.get('name')}: {e}."
)

if validation_errors:
Expand Down