mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix broken backup. (#54290)
This commit is contained in:
parent
534c833bb3
commit
5d460ae865
2 changed files with 6 additions and 6 deletions
|
@ -273,7 +273,7 @@ class PrivateKeyBase(crypto_utils.OpenSSLObject):
|
||||||
self.fingerprint = {}
|
self.fingerprint = {}
|
||||||
|
|
||||||
self.backup = module.params['backup']
|
self.backup = module.params['backup']
|
||||||
self.backup_path = None
|
self.backup_file = None
|
||||||
|
|
||||||
self.mode = module.params.get('mode', None)
|
self.mode = module.params.get('mode', None)
|
||||||
if self.mode is None:
|
if self.mode is None:
|
||||||
|
@ -352,8 +352,8 @@ class PrivateKeyBase(crypto_utils.OpenSSLObject):
|
||||||
'changed': self.changed,
|
'changed': self.changed,
|
||||||
'fingerprint': self.fingerprint,
|
'fingerprint': self.fingerprint,
|
||||||
}
|
}
|
||||||
if self.backup_path:
|
if self.backup_file:
|
||||||
result['backup_path'] = self.backup_path
|
result['backup_file'] = self.backup_file
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
@ -115,14 +115,14 @@
|
||||||
- passphrase_5 is changed
|
- passphrase_5 is changed
|
||||||
- passphrase_1.backup_file is undefined
|
- passphrase_1.backup_file is undefined
|
||||||
- passphrase_2.backup_file is undefined
|
- passphrase_2.backup_file is undefined
|
||||||
- passphrase_3.backup_file is not none
|
- passphrase_3.backup_file is string
|
||||||
- passphrase_4.backup_file is undefined
|
- passphrase_4.backup_file is undefined
|
||||||
- passphrase_5.backup_file is not none
|
- passphrase_5.backup_file is string
|
||||||
|
|
||||||
- name: Validate remove
|
- name: Validate remove
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- remove_1 is changed
|
- remove_1 is changed
|
||||||
- remove_2 is not changed
|
- remove_2 is not changed
|
||||||
- remove_1.backup_file is not none
|
- remove_1.backup_file is string
|
||||||
- remove_2.backup_file is undefined
|
- remove_2.backup_file is undefined
|
||||||
|
|
Loading…
Reference in a new issue