From 5d460ae8652e456667fde4d39ac2c3720c46abac Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 25 Mar 2019 14:19:25 +0100 Subject: [PATCH] Fix broken backup. (#54290) --- lib/ansible/modules/crypto/openssl_privatekey.py | 6 +++--- .../targets/openssl_privatekey/tests/validate.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/crypto/openssl_privatekey.py b/lib/ansible/modules/crypto/openssl_privatekey.py index 8955de73f9..0745322896 100644 --- a/lib/ansible/modules/crypto/openssl_privatekey.py +++ b/lib/ansible/modules/crypto/openssl_privatekey.py @@ -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 diff --git a/test/integration/targets/openssl_privatekey/tests/validate.yml b/test/integration/targets/openssl_privatekey/tests/validate.yml index c98fb35649..96bb1e586e 100644 --- a/test/integration/targets/openssl_privatekey/tests/validate.yml +++ b/test/integration/targets/openssl_privatekey/tests/validate.yml @@ -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