def copy_additional_logs_for_webcontainer(container, path, file_name): try: logs = docker_utils.get_archive_from_container(container, path, file_name) path = os.path.join(OUTPUT_FOLDER, '{}-{}'.format(container.name, file_name)) docker_utils.write_to_file(path, logs) return path except (KeyError, docker.errors.NotFound): pass
def get_container_inspect_logs(wa_container): container = wa_container.container inspect_log_filename = os.path.join( OUTPUT_FOLDER, "{}-inspect.log".format(container.name)) inspect_result = docker_utils.get_inspect_result(container) docker_utils.write_to_file(inspect_log_filename, json.dumps(inspect_result, indent=1)) return inspect_log_filename
def get_corecontainer_coredumps_logs(wa_container): container = wa_container.container core_dump_filename = None if wa_container.is_coreapp(): core_dump_filename = os.path.join( OUTPUT_FOLDER, "{}-coredump.log".format(container.name)) core_dump_results = docker_utils.get_core_dump_logs(container) docker_utils.write_to_file(core_dump_filename, core_dump_results) return core_dump_filename
def get_corecontainer_coredumps_logs(wa_container): container = wa_container.container container_type = wa_container.container_type core_dump_filename = None if docker_utils.WA_COREAPP_CONTAINER_TAG == container_type: core_dump_filename = os.path.join( OUTPUT_FOLDER, "{}-coredump.log".format(container.name)) core_dump_results = docker_utils.get_core_dump_logs(container) docker_utils.write_to_file(core_dump_filename, core_dump_results) return core_dump_filename
def get_support_info(): support_info_filename = os.path.join(OUTPUT_FOLDER, SUPPORT_INFO_LOG_FILE) try: config = Config().values if config: api = WABizAPI(**config.get("webapp")) support_info_content = api.get_support_info() else: return except Exception: return docker_utils.write_to_file(support_info_filename, json.dumps(support_info_content, indent=2)) return support_info_filename