1313def validate_custom_cli_downloads_urls_updated (
1414 admin_client : DynamicClient ,
1515 new_hostname : str | None = None ,
16- original_virtctl_console_cli_downloads_spec_links : list [str ] | None = None ,
16+ original_links : list [str ] | None = None ,
1717) -> None :
1818 """
1919 Validates that console CLI download URLs have been properly updated.
@@ -27,7 +27,7 @@ def validate_custom_cli_downloads_urls_updated(
2727 new_hostname (str, optional): New hostname that should be present in all URLs.
2828 If provided, validates that all URLs contain this hostname.
2929 Mutually exclusive with original_virtctl_console_cli_downloads_spec_links.
30- original_virtctl_console_cli_downloads_spec_links (list[str], optional):
30+ original_links (list[str], optional):
3131 Original list of CLI download URLs. If provided, validates that current
3232 URLs match these original URLs.
3333 Mutually exclusive with new_hostname.
@@ -40,7 +40,7 @@ def validate_custom_cli_downloads_urls_updated(
4040 ValueError: If both new_hostname and original_virtctl_console_cli_downloads_spec_links
4141 are provided, or if neither is provided.
4242 """
43- if (new_hostname is None ) == (original_virtctl_console_cli_downloads_spec_links is None ):
43+ if (new_hostname is None ) == (original_links is None ):
4444 raise ValueError (
4545 "Exactly one of 'new_hostname' or 'original_virtctl_console_cli_downloads_spec_links' "
4646 "must be provided, not both or neither."
@@ -58,18 +58,18 @@ def validate_custom_cli_downloads_urls_updated(
5858 try :
5959 for sample in samples :
6060 current_cli_spec_links = [url .href for url in sample ]
61- if original_virtctl_console_cli_downloads_spec_links :
62- if sorted (current_cli_spec_links ) == sorted (original_virtctl_console_cli_downloads_spec_links ):
61+ if original_links :
62+ if sorted (current_cli_spec_links ) == sorted (original_links ):
6363 return
6464 elif new_hostname :
6565 urls_not_updated_with_new_hostname = [url for url in current_cli_spec_links if new_hostname not in url ]
6666 if not urls_not_updated_with_new_hostname :
6767 return
6868 except TimeoutExpiredError :
69- if original_virtctl_console_cli_downloads_spec_links :
69+ if original_links :
7070 LOGGER .error (
7171 f"Failed to update cluster ingress downloads spec links to the original links: "
72- f"original_cli_spec_links: { original_virtctl_console_cli_downloads_spec_links } , "
72+ f"original_cli_spec_links: { original_links } , "
7373 f"current_cli_spec_links: { current_cli_spec_links } "
7474 )
7575 else :
0 commit comments