fix: add warning when openssh-keypair has private_key_format specified with opensshbin (#512)

This commit is contained in:
Andrew Pantuso
2022-09-19 14:10:21 -04:00
committed by GitHub
parent a0d862e1f1
commit 829707fc5a

View File

@@ -312,6 +312,12 @@ class KeypairBackendOpensshBin(KeypairBackend):
def __init__(self, module):
super(KeypairBackendOpensshBin, self).__init__(module)
if self.module.params['private_key_format'] != 'auto':
self.module.fail_json(
msg="'auto' is the only valid option for " +
"'private_key_format' when 'backend' is not 'cryptography'"
)
self.ssh_keygen = KeygenCommand(self.module)
def _generate_keypair(self, private_key_path):