def get_cli_body_ssh(command, response, module):
 if ('^' == response[0]):
  body = []
 elif ('running' in command):
  body = response
 else:
  if (command in response[0]):
   response = [response[0].split(command)[1]]
  try:
   body = [json.loads(response[0])]
  except ValueError:
   module.fail_json(msg='Command does not support JSON output', command=command)
 return body

def get_cli_body_ssh ( command , response , module ) : if ( '^' == response [ 0 ] ) : body = [ ] elif ( 'running' in command ) : body = response else : if ( command in response [ 0 ] ) : response = [ response [ 0 ] . split ( command ) [ 1 ] ] try : body = [ json . loads ( response [ 0 ] ) ] except ValueError : module . fail_json ( msg = 'Command does not support JSON output' , command = command ) return body
get response for when transport=cli .