From 751351a147360ba53713e65036704e0d92111afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Bia=C5=82obrzecki?= Date: Sun, 13 Mar 2022 21:08:23 +0100 Subject: [PATCH] Download files with deb and rpm extensions to packages subdirectory (#3015) --- .../files/download-requirements/src/mode/debian_family_mode.py | 3 ++- .../download-requirements/src/mode/red_hat_family_mode.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ansible/playbooks/roles/repository/files/download-requirements/src/mode/debian_family_mode.py b/ansible/playbooks/roles/repository/files/download-requirements/src/mode/debian_family_mode.py index 26c2394114..6a440322c0 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/src/mode/debian_family_mode.py +++ b/ansible/playbooks/roles/repository/files/download-requirements/src/mode/debian_family_mode.py @@ -106,7 +106,8 @@ def _download_packages(self): os.chdir(self._cfg.script_path) def _download_file(self, file: str): - self._tools.wget.download(file, directory_prefix=self._cfg.dest_files) + output_path: Path = self._cfg.dest_packages if file.endswith('.deb') else self._cfg.dest_files + self._tools.wget.download(file, directory_prefix=output_path) def _download_grafana_dashboard(self, dashboard: str, output_file: Path): self._tools.wget.download(dashboard, output_document=output_file) diff --git a/ansible/playbooks/roles/repository/files/download-requirements/src/mode/red_hat_family_mode.py b/ansible/playbooks/roles/repository/files/download-requirements/src/mode/red_hat_family_mode.py index ee8601c712..5f91551e3d 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/src/mode/red_hat_family_mode.py +++ b/ansible/playbooks/roles/repository/files/download-requirements/src/mode/red_hat_family_mode.py @@ -187,7 +187,8 @@ def _download_packages(self): destdir=self._cfg.dest_packages) def _download_file(self, file: str): - self._tools.wget.download(file, directory_prefix=self._cfg.dest_files, additional_params=False) + output_path: Path = self._cfg.dest_packages if file.endswith('.rpm') else self._cfg.dest_files + self._tools.wget.download(file, directory_prefix=output_path, additional_params=False) def _download_grafana_dashboard(self, dashboard: str, output_file: Path): self._tools.wget.download(dashboard, output_document=output_file, additional_params=False)