File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ def connect(
125125 database : str ,
126126 password : str ,
127127 port : int = 5439 ,
128- host : str = "localhost " ,
128+ host : str = "" ,
129129 source_address : typing .Optional [str ] = None ,
130130 unix_sock : typing .Optional [str ] = None ,
131131 ssl : bool = True ,
Original file line number Diff line number Diff line change @@ -377,9 +377,11 @@ def set_cluster_credentials(
377377 else :
378378 client = boto3 .client (service_name = "redshift" , ** session_credentials )
379379
380- response = client .describe_clusters (ClusterIdentifier = info .cluster_identifier )
381- info .host = response ["Clusters" ][0 ]["Endpoint" ]["Address" ]
382- info .port = response ["Clusters" ][0 ]["Endpoint" ]["Port" ]
380+ if info .host is None or info .host == "" or info .port is None or info .port == "" :
381+ response = client .describe_clusters (ClusterIdentifier = info .cluster_identifier )
382+
383+ info .host = response ["Clusters" ][0 ]["Endpoint" ]["Address" ]
384+ info .port = response ["Clusters" ][0 ]["Endpoint" ]["Port" ]
383385
384386 # temporary credentials are cached by redshift_connector and will be used if they have not expired
385387 cache_key : str = IamHelper .get_credentials_cache_key (info )
You can’t perform that action at this time.
0 commit comments