Tendrl / commons

Common code usable by all Tendrl components

Home Page:http://www.tendrl.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Format of data returned by AnsibleRunner.run() method is not consistent

anmolsachan opened this issue · comments

Exceptions data is not returned properly in AnsibleRunner.run() method (

) due to which the code execution fails when there is an exception during Ansible command run.

This issue is not completely reproducible by needs to be handled.

More info:

Failure in Job 4a5268f9-54e1-4d76-9738-af1b096e1825 Flow tendrl.objects.Node.flows.StopServices with error:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/tendrl/commons/jobs/init.py", line 242,
in process_job the_flow.run()
File "/usr/lib/python2.7/site-packages/tendrl/commons/objects/node/flows/stop_services/init.py", line 14,
in run srv = NS.tendrl.objects.Service(service=service)
File "/usr/lib/python2.7/site-packages/tendrl/commons/objects/service/init.py", line 9,
in init service_detail = self.get_service_info(service)
File "/usr/lib/python2.7/site-packages/tendrl/commons/objects/service/init.py", line 18,
in get_service_info return {"exists": service.exists(), "running": service.status()}
File "/usr/lib/python2.7/site-packages/tendrl/commons/utils/service_status.py", line 32,
in status stdout, stderr, rc = self._execute_service_command('is-active')
File "/usr/lib/python2.7/site-packages/tendrl/commons/utils/service_status.py", line 16,
in _execute_service_command return command.run()
File "/usr/lib/python2.7/site-packages/tendrl/commons/utils/cmd_utils.py", line 78,
in run stdout = result.get("stdout", "") AttributeError: 'str' object has no attribute 'get'