Agent: Improve TCP port discovery log message

This commit is contained in:
Mike Salvatore 2022-06-27 17:28:41 -04:00
parent 596bacfa36
commit 9f2d56259c
1 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import logging
import select
import socket
import time
from pprint import pformat
from typing import Iterable, Mapping, Tuple
from common.utils import Timer
@ -110,9 +111,9 @@ def _check_tcp_ports(
sockets_to_try = sockets_to_try - connected_ports
logger.debug(
"On host %s discovered the following ports %s"
% (str(ip), ",".join([str(s[0]) for s in connected_ports]))
logger.info(
f"Discovered the following ports on {ip}: "
f"{pformat([port for port, _ in connected_ports])}"
)
open_ports = {port: "" for port, _ in connected_ports}