Skip to content

Commit

Permalink
Merge pull request #1020 from ATIX-AG/suppress_python_apt_warning
Browse files Browse the repository at this point in the history
Suppress the warnings about python3-apt not being installed

(cherry picked from commit 98d8266)
  • Loading branch information
quba42 authored and patchback[bot] committed Feb 27, 2024
1 parent 6eae62c commit 1b57a35
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES/1019.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Suppressed deb822's confusing log warning about python-apt not being installed.
8 changes: 6 additions & 2 deletions pulp_deb/app/tasks/synchronizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] == "/":
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pulp_deb/tests/functional/api/test_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def parse_package_index(pkg_idx):
Returns a dict of the packages by '<Package>-<Version>-<Architecture>'.
"""
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
Expand Down

0 comments on commit 1b57a35

Please sign in to comment.