mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
commit
bd7de28a64
2 changed files with 4 additions and 3 deletions
|
@ -312,7 +312,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
|
|||
|
||||
def on_skipped(self, host, item=None):
|
||||
|
||||
msg = ''
|
||||
msg = ''
|
||||
if item:
|
||||
msg = "skipping: [%s] => (item=%s)" % (host, item)
|
||||
else:
|
||||
|
|
|
@ -312,6 +312,7 @@ def core(module):
|
|||
v = Virt()
|
||||
res = {}
|
||||
|
||||
|
||||
if state:
|
||||
if not guest:
|
||||
module.fail_json(msg = "state change requires a guest specified")
|
||||
|
@ -337,13 +338,13 @@ def core(module):
|
|||
res = getattr(v, command)(guest)
|
||||
if type(res) != dict:
|
||||
res = { command: res }
|
||||
return rc, res
|
||||
return VIRT_SUCCESS, res
|
||||
|
||||
elif hasattr(v, command):
|
||||
res = getattr(v, command)()
|
||||
if type(res) != dict:
|
||||
res = { command: res }
|
||||
return rc, res
|
||||
return VIRT_SUCCESS, res
|
||||
|
||||
else:
|
||||
module.fail_json(msg="Command %s not recognized" % basecmd)
|
||||
|
|
Loading…
Reference in a new issue