diff --git a/capella/download_archive.py b/capella/download_archive.py index 94cbb1c1..03bf7b7c 100644 --- a/capella/download_archive.py +++ b/capella/download_archive.py @@ -21,14 +21,14 @@ def get_directory_structure(url: str) -> list[str]: - response = requests.get(url) + response = requests.get(url, timeout=10) response.raise_for_status() tree = etree.fromstring(response.content, parser=html.HTMLParser()) return tree.xpath("//*/a/text()") -if __name__ == "__main__": +def main() -> None: capella_version = sys.argv[1] print(f"Installing Capella {capella_version}") @@ -55,8 +55,10 @@ def get_directory_structure(url: str) -> list[str]: f"{capella_archive_path}{archive_name}" ) - download_response = requests.get(download_url) + download_response = requests.get(download_url, timeout=120) download_response.raise_for_status() - download_path = pathlib.Path("/opt/capella.tar.gz").write_bytes( - download_response.content - ) + pathlib.Path("/opt/capella.tar.gz").write_bytes(download_response.content) + + +if __name__ == "__main__": + main() diff --git a/pyproject.toml b/pyproject.toml index c80ec105..7e200047 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -117,6 +117,7 @@ disable = [ "too-few-public-methods", "too-many-ancestors", "too-many-arguments", + "too-many-positional-arguments", "too-many-boolean-expressions", "too-many-branches", "too-many-instance-attributes",