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

pull/514/head
Andrew Pantuso 2022-09-19 14:10:21 -04:00 committed by GitHub
parent a0d862e1f1
commit 829707fc5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -312,6 +312,12 @@ class KeypairBackendOpensshBin(KeypairBackend):
def __init__(self, module): def __init__(self, module):
super(KeypairBackendOpensshBin, self).__init__(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) self.ssh_keygen = KeygenCommand(self.module)
def _generate_keypair(self, private_key_path): def _generate_keypair(self, private_key_path):