java_keystore: simplify code (#10905)

* java_keystore: simplify code

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-10-11 22:46:04 +13:00 committed by GitHub
commit 8a1ed41fe5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- java_keystore - remove redundant function (https://github.com/ansible-collections/community.general/pull/10905).

View file

@ -259,7 +259,7 @@ class JavaKeystore:
except (OSError, ValueError) as e:
self.module.fail_json(msg="Unable to read the provided certificate: %s" % to_native(e))
fp = hex_decode(cert.fingerprint(hashes.SHA256())).upper()
fp = cert.fingerprint(hashes.SHA256()).hex().upper()
fingerprint = ':'.join([fp[i:i + 2] for i in range(0, len(fp), 2)])
else:
current_certificate_fingerprint_cmd = [
@ -507,10 +507,6 @@ def create_file(content):
return tmpfile
def hex_decode(s):
return s.hex()
def main():
choose_between = (['certificate', 'certificate_path'],
['private_key', 'private_key_path'])