Fix blake2b call when fips enabled

digest_size parameter isn't available for the openssl
implementation of blake2b. The openssl blake2b implementation
is being used in the telemetry fips job. The job is failing
at the moment due to the gnocchi publisher using the
digest_size parameter.

The openssl version installed on centos 9s used for fips
tests in CI doesn't consider blake2b secure, so usedforsecurity=False
is required.

Depends-On: https://review.opendev.org/c/openstack/telemetry-tempest-plugin/+/978293/4
Change-Id: I622aca82fb4b2ba4b736a35d3c0af47297d51888
Signed-off-by: Jaromir Wysoglad <jwysogla@redhat.com>
This commit is contained in:
Jaromir Wysoglad
2026-03-04 09:39:30 +00:00
parent 0cd03d72a5
commit d1c2fd8a8c

View File

@@ -544,7 +544,9 @@ class GnocchiPublisher(publisher.ConfigPublisherBase):
def _hash_resource(resource):
data = {k: v for k, v in resource.items() if k != 'metrics'}
payload = json.dumps(data, sort_keys=True, separators=(',', ':'))
return hashlib.blake2b(payload.encode(), digest_size=16).hexdigest()
return hashlib.blake2b(
payload.encode(), usedforsecurity=False
).hexdigest()
def _resource_cache_diff(self, key, attribute_hash):
cached_hash = self.cache.get(key)