From 98393c03f3f74037e74c868e928367a26fe8c64f Mon Sep 17 00:00:00 2001 From: David Davis Date: Mon, 18 Dec 2023 15:52:48 -0500 Subject: [PATCH] Fix APT_BY_HASH setting fixes #984 --- CHANGES/984.bugfix | 1 + pulp_deb/app/tasks/publishing.py | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 CHANGES/984.bugfix diff --git a/CHANGES/984.bugfix b/CHANGES/984.bugfix new file mode 100644 index 000000000..cbb377b8d --- /dev/null +++ b/CHANGES/984.bugfix @@ -0,0 +1 @@ +Fixed a bug where enabling the ``APT_BY_HASH`` setting did not enable the feature. diff --git a/pulp_deb/app/tasks/publishing.py b/pulp_deb/app/tasks/publishing.py index bc1cdabe8..0befd4d20 100644 --- a/pulp_deb/app/tasks/publishing.py +++ b/pulp_deb/app/tasks/publishing.py @@ -45,8 +45,6 @@ CHECKSUM_TYPE_MAP, ) -from pulp_deb.app.settings import APT_BY_HASH - import logging from gettext import gettext as _ @@ -356,7 +354,7 @@ def finish(self): gz_package_index.save() # Generating metadata files using checksum - if APT_BY_HASH: + if settings.APT_BY_HASH: for path, index in ( (package_index_path, package_index), (gz_package_index_path, gz_package_index), @@ -425,7 +423,7 @@ def __init__( self.release["Components"] = "" # Will be set later if release.description != NULL_VALUE: self.release["Description"] = release.description - self.release["Acquire-By-Hash"] = "yes" if APT_BY_HASH else "no" + self.release["Acquire-By-Hash"] = "yes" if settings.APT_BY_HASH else "no" for checksum_type, deb_field in CHECKSUM_TYPE_MAP.items(): if checksum_type in settings.ALLOWED_CONTENT_CHECKSUMS: