Extract Cluster FQDN from Redis URL
(url)
| 209 | |
| 210 | |
| 211 | def 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 | |
| 229 | def _prepare_ssl_certificates(cert_chain: bool) -> dict: |
no outgoing calls
no test coverage detected