Skip to content

Commit cdd9a35

Browse files
committed
fix: netcat issue with async initalization
Change-Id: Ie508d0bab7dd7d106522737b00cfe897777e5ee9
1 parent 55d8023 commit cdd9a35

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

quads/tools/netcat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def __init__(self, ip, port=22, loop=None):
1515
self.loop = loop if loop else get_running_loop()
1616

1717
async def __aenter__(self):
18+
await self.connect()
1819
return self
1920

2021
async def __aexit__(self, *args):

quads/tools/validate_env.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ async def post_system_test(self):
127127
for host in pending:
128128
logger.info(host)
129129
try:
130-
async with Netcat(host) as nc:
131-
healthy = await nc.health_check()
130+
nc = Netcat(host)
131+
healthy = await nc.health_check()
132132
except OSError:
133133
healthy = False
134134
if not healthy:
@@ -190,8 +190,8 @@ async def post_network_test(self):
190190
hosts_down = []
191191
for host in self.hosts:
192192
try:
193-
async with Netcat(host.name) as nc:
194-
healthy = await nc.health_check()
193+
nc = Netcat(host.name)
194+
healthy = await nc.health_check()
195195
except OSError:
196196
healthy = False
197197
if not healthy:

0 commit comments

Comments
 (0)