diff --git a/quads/tools/netcat.py b/quads/tools/netcat.py index 31ed800a9..bde583cf1 100755 --- a/quads/tools/netcat.py +++ b/quads/tools/netcat.py @@ -15,6 +15,7 @@ def __init__(self, ip, port=22, loop=None): self.loop = loop if loop else get_running_loop() async def __aenter__(self): + await self.connect() return self async def __aexit__(self, *args): diff --git a/quads/tools/validate_env.py b/quads/tools/validate_env.py index 45bf4c935..79c26dd19 100755 --- a/quads/tools/validate_env.py +++ b/quads/tools/validate_env.py @@ -127,8 +127,8 @@ async def post_system_test(self): for host in pending: logger.info(host) try: - async with Netcat(host) as nc: - healthy = await nc.health_check() + nc = Netcat(host) + healthy = await nc.health_check() except OSError: healthy = False if not healthy: @@ -190,8 +190,8 @@ async def post_network_test(self): hosts_down = [] for host in self.hosts: try: - async with Netcat(host.name) as nc: - healthy = await nc.health_check() + nc = Netcat(host.name) + healthy = await nc.health_check() except OSError: healthy = False if not healthy: