MCPcopy
hub / github.com/redis/redis-py / extract_cluster_fqdn

Function extract_cluster_fqdn

tests/test_scenario/conftest.py:211–226  ·  view source on GitHub ↗

Extract Cluster FQDN from Redis URL

(url)

Source from the content-addressed store, hash-verified

209
210
211def extract_cluster_fqdn(url):
212 """
213 Extract Cluster FQDN from Redis URL
214 """
215 # Parse the URL
216 parsed = urlparse(url)
217
218 # Extract hostname and port
219 hostname = parsed.hostname
220
221 # Remove the 'redis-XXXX.' prefix using regex
222 # This pattern matches 'redis-' followed by digits and a dot
223 cleaned_hostname = re.sub(r"^redis-\d+\.", "", hostname)
224
225 # Reconstruct the URL
226 return f"https://{cleaned_hostname}"
227
228
229def _prepare_ssl_certificates(cert_chain: bool) -> dict:

Callers 2

r_multi_dbFunction · 0.90
r_multi_dbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected