mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-07 05:43:06 +00:00
fix custom file attributes for public keys (#257)
Use of the confusingly-named _permissions_changed() on both sides of an `or` was resulting in the second invocation not being reached if the first invocation returned True, which it does any time it applied custom attributes to the private key. As a result, custom file attributes were only ever being applied to the private key (except in one specific case) This is fixed by explicitly updating attributes of both files before checking if changes have been made. Signed-off-by: Charlie Wheeler-Robinson <cwheeler@redhat.com>
This commit is contained in:
committed by
GitHub
parent
4908f1a8ec
commit
6c989de994
@@ -118,7 +118,9 @@ class KeypairBackend(object):
|
||||
self.module.fail_json(msg='Unable to update the comment for the public key.')
|
||||
self._update_comment()
|
||||
|
||||
if self._permissions_changed() or self._permissions_changed(public_key=True):
|
||||
private_key_perms_changed = self._permissions_changed()
|
||||
public_key_perms_changed = self._permissions_changed(public_key=True)
|
||||
if private_key_perms_changed or public_key_perms_changed:
|
||||
self.changed = True
|
||||
|
||||
def is_private_key_valid(self, perms_required=True):
|
||||
|
||||
Reference in New Issue
Block a user