summaryrefslogtreecommitdiffstats
path: root/tools/inspect_os.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/inspect_os.py')
-rw-r--r--tools/inspect_os.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/inspect_os.py b/tools/inspect_os.py
index 892ca8a..e374464 100644
--- a/tools/inspect_os.py
+++ b/tools/inspect_os.py
@@ -36,15 +36,17 @@ def get_linux_os_info(path):
release_files = {}
for root, dirs, _ in os.walk(path):
if "etc" in dirs:
- skip = False
for f in iglob(f"{root}/etc/*release"):
# Hack for immutable operating systems of Fedora.
if not os.path.exists(f):
- skip = True
+ release_files.clear()
break
- release_files[os.path.basename(f)] = f
- if release_files and not skip:
- break
+ if os.path.isfile(f):
+ release_files[os.path.basename(f)] = f
+ else:
+ if release_files:
+ break
+ continue
if not release_files:
L.debug("no release file found")