in wadebug/wa_actions/docker_utils.py [0:0]
def get_core_dump_logs(container):
client = docker.from_env()
files_changed = client.api.diff(container.short_id)
coredump_logs = []
for file_change in files_changed:
file_change_type = file_change["Kind"]
full_path = file_change["Path"]
# the crash files should have names like:
# /usr/local/waent/logs/wa-service-bffb11a7-crash.log
if (
"-crash.log" in full_path
and file_change_type != DockerDiffFileChange.DELETED
):
folder_path, file_name = full_path.rsplit("/", 1)
coredump = get_archive_from_container(container, folder_path, file_name)
coredump_logs.append(coredump)
result = "\n".join(coredump_logs)
return result