|
|
@ -312,6 +312,7 @@ def core(module):
|
|
|
|
v = Virt()
|
|
|
|
v = Virt()
|
|
|
|
res = {}
|
|
|
|
res = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if state:
|
|
|
|
if state:
|
|
|
|
if not guest:
|
|
|
|
if not guest:
|
|
|
|
module.fail_json(msg = "state change requires a guest specified")
|
|
|
|
module.fail_json(msg = "state change requires a guest specified")
|
|
|
@ -337,13 +338,13 @@ def core(module):
|
|
|
|
res = getattr(v, command)(guest)
|
|
|
|
res = getattr(v, command)(guest)
|
|
|
|
if type(res) != dict:
|
|
|
|
if type(res) != dict:
|
|
|
|
res = { command: res }
|
|
|
|
res = { command: res }
|
|
|
|
return rc, res
|
|
|
|
return VIRT_SUCCESS, res
|
|
|
|
|
|
|
|
|
|
|
|
elif hasattr(v, command):
|
|
|
|
elif hasattr(v, command):
|
|
|
|
res = getattr(v, command)()
|
|
|
|
res = getattr(v, command)()
|
|
|
|
if type(res) != dict:
|
|
|
|
if type(res) != dict:
|
|
|
|
res = { command: res }
|
|
|
|
res = { command: res }
|
|
|
|
return rc, res
|
|
|
|
return VIRT_SUCCESS, res
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
module.fail_json(msg="Command %s not recognized" % basecmd)
|
|
|
|
module.fail_json(msg="Command %s not recognized" % basecmd)
|
|
|
|