Merge pull request #11925 from resmo/feature/get_result
cloudstack: add get_result() in utils to return common results
This commit is contained in:
commit
6338c3b28c
1 changed files with 15 additions and 0 deletions
|
@ -366,3 +366,18 @@ class AnsibleCloudStack:
|
||||||
break
|
break
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
return job
|
return job
|
||||||
|
|
||||||
|
|
||||||
|
def get_result(self, resource):
|
||||||
|
if resource:
|
||||||
|
if 'id' in resource:
|
||||||
|
self.result['id'] = resource['id']
|
||||||
|
if 'project' in resource:
|
||||||
|
self.result['project'] = resource['project']
|
||||||
|
if 'domain' in resource:
|
||||||
|
self.result['domain'] = resource['domain']
|
||||||
|
if 'account' in resource:
|
||||||
|
self.result['account'] = resource['account']
|
||||||
|
if 'zonename' in resource:
|
||||||
|
self.result['zone'] = resource['zonename']
|
||||||
|
return self.result
|
||||||
|
|
Loading…
Reference in a new issue