mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
cloudstack: use new get_result() handling
This commit is contained in:
parent
41315b2cd9
commit
65dc7af166
17 changed files with 207 additions and 416 deletions
|
@ -77,6 +77,11 @@ EXAMPLES = '''
|
|||
|
||||
RETURN = '''
|
||||
---
|
||||
id:
|
||||
description: UUID of the SSH public key.
|
||||
returned: success
|
||||
type: string
|
||||
sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f
|
||||
name:
|
||||
description: Name of the SSH public key.
|
||||
returned: success
|
||||
|
@ -112,7 +117,11 @@ from ansible.module_utils.cloudstack import *
|
|||
class AnsibleCloudStackSshKey(AnsibleCloudStack):
|
||||
|
||||
def __init__(self, module):
|
||||
AnsibleCloudStack.__init__(self, module)
|
||||
super(AnsibleCloudStackSshKey, self).__init__(module)
|
||||
self.returns = {
|
||||
'privatekey': 'private_key',
|
||||
'fingerprint': 'fingerprint',
|
||||
}
|
||||
self.ssh_key = None
|
||||
|
||||
|
||||
|
@ -189,16 +198,6 @@ class AnsibleCloudStackSshKey(AnsibleCloudStack):
|
|||
return self.ssh_key
|
||||
|
||||
|
||||
def get_result(self, ssh_key):
|
||||
if ssh_key:
|
||||
if 'fingerprint' in ssh_key:
|
||||
self.result['fingerprint'] = ssh_key['fingerprint']
|
||||
if 'name' in ssh_key:
|
||||
self.result['name'] = ssh_key['name']
|
||||
if 'privatekey' in ssh_key:
|
||||
self.result['private_key'] = ssh_key['privatekey']
|
||||
return self.result
|
||||
|
||||
|
||||
def _get_ssh_fingerprint(self, public_key):
|
||||
key = sshpubkeys.SSHKey(public_key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue