Skip to content

Commit 65ef069

Browse files
committed
test: do not unpack result
1 parent b8c9e31 commit 65ef069

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

testinfra/test_ami_nix.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,18 +363,16 @@ def is_healthy(host, instance_ip, ssh_identity_file) -> bool:
363363
try:
364364
if service == "postgres":
365365
# For PostgreSQL, we need to check multiple things
366-
systemd_status, socket_check, pg_isready = check(host)
366+
pg_isready = check(host)
367367

368-
if systemd_status.failed:
369-
logger.error("PostgreSQL systemd service is not active")
370-
logger.error(f"systemd status: {systemd_status.stdout}")
371-
logger.error(f"systemd error: {systemd_status.stderr}")
368+
if pg_isready.failed:
369+
logger.error("PostgreSQL is not ready")
370+
logger.error(f"pg_isready stdout: {pg_isready.stdout}")
371+
logger.error(f"pg_isready stderr: {pg_isready.stderr}")
372372

373373
# Run detailed checks since we know we have a working connection
374374
run_detailed_checks(host)
375-
376-
if any(cmd.failed for cmd in [systemd_status, socket_check, pg_isready]):
377-
return False
375+
return False
378376
else:
379377
cmd = check(host)
380378
if cmd.failed is True:

0 commit comments

Comments
 (0)