Fix broken backup. (#54290)

pull/54337/head
Felix Fontein 5 years ago committed by Martin Krizek
parent 534c833bb3
commit 5d460ae865

@ -273,7 +273,7 @@ class PrivateKeyBase(crypto_utils.OpenSSLObject):
self.fingerprint = {}
self.backup = module.params['backup']
self.backup_path = None
self.backup_file = None
self.mode = module.params.get('mode', None)
if self.mode is None:
@ -352,8 +352,8 @@ class PrivateKeyBase(crypto_utils.OpenSSLObject):
'changed': self.changed,
'fingerprint': self.fingerprint,
}
if self.backup_path:
result['backup_path'] = self.backup_path
if self.backup_file:
result['backup_file'] = self.backup_file
return result

@ -115,14 +115,14 @@
- passphrase_5 is changed
- passphrase_1.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_5.backup_file is not none
- passphrase_5.backup_file is string
- name: Validate remove
assert:
that:
- remove_1 is 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

Loading…
Cancel
Save