Skip to content

Commit

Permalink
fix: netcat issue with async initalization
Browse files Browse the repository at this point in the history
Change-Id: Ie508d0bab7dd7d106522737b00cfe897777e5ee9
  • Loading branch information
grafuls committed Feb 7, 2022
1 parent 55d8023 commit cdd9a35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions quads/tools/netcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions quads/tools/validate_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit cdd9a35

Please sign in to comment.