mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -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
|
@ -80,6 +80,11 @@ EXAMPLES = '''
|
|||
|
||||
RETURN = '''
|
||||
---
|
||||
id:
|
||||
description: UUID of the affinity group.
|
||||
returned: success
|
||||
type: string
|
||||
sample: 87b1e0ce-4e01-11e4-bb66-0050569e64b8
|
||||
name:
|
||||
description: Name of affinity group.
|
||||
returned: success
|
||||
|
@ -110,7 +115,10 @@ from ansible.module_utils.cloudstack import *
|
|||
class AnsibleCloudStackAffinityGroup(AnsibleCloudStack):
|
||||
|
||||
def __init__(self, module):
|
||||
AnsibleCloudStack.__init__(self, module)
|
||||
super(AnsibleCloudStackAffinityGroup, self).__init__(module)
|
||||
self.returns = {
|
||||
'type': 'affinity_type',
|
||||
}
|
||||
self.affinity_group = None
|
||||
|
||||
|
||||
|
@ -191,21 +199,6 @@ class AnsibleCloudStackAffinityGroup(AnsibleCloudStack):
|
|||
return affinity_group
|
||||
|
||||
|
||||
def get_result(self, affinity_group):
|
||||
if affinity_group:
|
||||
if 'name' in affinity_group:
|
||||
self.result['name'] = affinity_group['name']
|
||||
if 'description' in affinity_group:
|
||||
self.result['description'] = affinity_group['description']
|
||||
if 'type' in affinity_group:
|
||||
self.result['affinity_type'] = affinity_group['type']
|
||||
if 'domain' in affinity_group:
|
||||
self.result['domain'] = affinity_group['domain']
|
||||
if 'account' in affinity_group:
|
||||
self.result['account'] = affinity_group['account']
|
||||
return self.result
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue