From 1b57a35ae769afad880a119d8a172ea5f517e7d7 Mon Sep 17 00:00:00 2001 From: Quirin Pamp Date: Tue, 27 Feb 2024 12:14:32 +0100 Subject: [PATCH] Merge pull request #1020 from ATIX-AG/suppress_python_apt_warning Suppress the warnings about python3-apt not being installed (cherry picked from commit 98d826674f203317e615c3568ff67f2ceb82c6c4) --- CHANGES/1019.bugfix | 1 + pulp_deb/app/tasks/synchronizing.py | 8 ++++++-- pulp_deb/tests/functional/api/test_publish.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 CHANGES/1019.bugfix diff --git a/CHANGES/1019.bugfix b/CHANGES/1019.bugfix new file mode 100644 index 000000000..ce0b17303 --- /dev/null +++ b/CHANGES/1019.bugfix @@ -0,0 +1 @@ +Suppressed deb822's confusing log warning about python-apt not being installed. diff --git a/pulp_deb/app/tasks/synchronizing.py b/pulp_deb/app/tasks/synchronizing.py index 023f972eb..869814b30 100644 --- a/pulp_deb/app/tasks/synchronizing.py +++ b/pulp_deb/app/tasks/synchronizing.py @@ -932,7 +932,9 @@ async def _handle_package_index( # parse package_index package_futures = [] package_index_artifact = await _get_main_artifact_blocking(package_index) - for package_paragraph in deb822.Packages.iter_paragraphs(package_index_artifact.file): + for package_paragraph in deb822.Packages.iter_paragraphs( + package_index_artifact.file, use_apt_pkg=False + ): # Sanity check the architecture from the package paragraph: package_paragraph_architecture = package_paragraph["Architecture"] if release_file.distribution[-1] == "/": @@ -1108,7 +1110,9 @@ async def _handle_source_index(self, release_file, release_component, file_refer # parse source_index source_package_content_futures = [] source_index_artifact = await _get_main_artifact_blocking(source_index) - for source_paragraph in deb822.Sources.iter_paragraphs(source_index_artifact.file): + for source_paragraph in deb822.Sources.iter_paragraphs( + source_index_artifact.file, use_apt_pkg=False + ): try: source_dir = source_paragraph["Directory"] source_relpath = os.path.join(source_dir, "blah") diff --git a/pulp_deb/tests/functional/api/test_publish.py b/pulp_deb/tests/functional/api/test_publish.py index 961b72383..1ff174f00 100644 --- a/pulp_deb/tests/functional/api/test_publish.py +++ b/pulp_deb/tests/functional/api/test_publish.py @@ -496,7 +496,7 @@ def parse_package_index(pkg_idx): Returns a dict of the packages by '--'. """ packages = {} - for package in deb822.Packages.iter_paragraphs(pkg_idx): + for package in deb822.Packages.iter_paragraphs(pkg_idx, use_apt_pkg=False): packages[ "-".join([package["Package"], package["Version"], package["Architecture"]]) ] = package