Angie and nginx doesn't have --version parameter

This commit is contained in:
Yaroslava Lukoyanova 2024-01-17 18:53:02 +03:00
parent 40fa2c24cc
commit c9c0cd2c92

View file

@ -57,6 +57,9 @@ def get_remote_binaries_versions(hosting: Hosting) -> dict[str, str]:
for binary_name, binary in binary_path_by_name.items():
try:
binary_path = binary["exec_path"]
if "angie" in binary_name or "nginx" in binary_name:
result = shell.exec(f"{binary_path} -version")
else:
result = shell.exec(f"{binary_path} --version")
versions_at_host[binary_name] = {"version": _parse_version(result.stdout), "check": binary["check"]}
except Exception as exc: