- ok_flag = line.split(':')[1].strip().split('=')[1].split('changed')[0].strip()
- changed_flag = line.split(':')[1].strip().split('=')[2].split('unreachable')[0].strip()
- unreachable_flag = line.split(':')[1].strip().split('=')[3].split('failed')[0].strip()
- failed_flag = line.split(':')[1].strip().split('=')[4].strip()
+ exec_results = line.split(':')[1].strip()
+
+ result_items = [item for item in exec_results.split(' ') if item]
+ cherrypy.log("Execcution results of '%s': %s" % (ip_address, str(result_items)))
+ # ['ok=6', 'changed=5', 'unreachable=0', 'failed=0', 'skipped=3', 'rescued=0', 'ignored=0']
+
+ ok_flag = result_items[0].split('=')[1].strip()
+ changed_flag = result_items[1].split('=')[1].strip()
+ unreachable_flag = result_items[2].split('=')[1].strip()
+ failed_flag = result_items[3].split('=')[1].strip()
+