From b35b3dad82a4fc6dd8b80bcf5602e8a7b459a273 Mon Sep 17 00:00:00 2001 From: ondrno Date: Sun, 26 Feb 2023 01:40:20 +0100 Subject: [PATCH] check if key "distribution" exists --- testinfra/modules/systeminfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testinfra/modules/systeminfo.py b/testinfra/modules/systeminfo.py index ba250359..907ea279 100644 --- a/testinfra/modules/systeminfo.py +++ b/testinfra/modules/systeminfo.py @@ -79,7 +79,7 @@ def _get_linux_sysinfo(self): line[len(key) :].replace('"', "").replace("'", "").strip() ) # Arch doesn't have releases - if sysinfo["distribution"] == "arch": + if "distribution" in sysinfo and sysinfo["distribution"] == "arch": sysinfo["release"] = "rolling" return sysinfo