Retry ssh check if connection reset (#3065)

This commit is contained in:
maddieford 2024-02-22 15:12:14 -08:00 коммит произвёл GitHub
Родитель df7be2d221
Коммит 591b5492ba
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -491,7 +491,7 @@ class AgentTestSuite(LisaTestSuite):
break break
except CommandError as error: except CommandError as error:
# Check for "System is booting up. Unprivileged users are not permitted to log in yet. Please come back later. For technical details, see pam_nologin(8)." # Check for "System is booting up. Unprivileged users are not permitted to log in yet. Please come back later. For technical details, see pam_nologin(8)."
if not any(m in error.stderr for m in ["Unprivileged users are not permitted to log in yet", "Permission denied"]): if not any(m in error.stderr for m in ["Unprivileged users are not permitted to log in yet", "Permission denied", "Connection reset by peer"]):
raise raise
if attempt >= max_attempts - 1: if attempt >= max_attempts - 1:
raise Exception(f"SSH connectivity check failed after {max_attempts} attempts, giving up [{error}]") raise Exception(f"SSH connectivity check failed after {max_attempts} attempts, giving up [{error}]")