def METHOD_NAME(client, cmd_list, iteration, file):
    try:
        with open(file, "a+") as f:
            f.write(f"{'*' * 20} Report for Iteration {iteration} {'*' * 20} \n")
            for cmd in cmd_list:
                out, rc = client.exec_command(
                    sudo=True, cmd=f"{cmd} --format json-pretty"
                )
                f.write(f"{cmd}\n")
                output = json.loads(out)
                log.info(output)
                f.write(json.dumps(output, indent=4))
                f.write("\n")
            f.write(f"{'*' * 20} Iteration {iteration} completed {'*' * 20} ")
    finally:
        f.close()