Added minor changes (documentation) and indentation for readability.

Readme correct referencing to new docs directory its file.
    couple comments and indentations to improve readability.
    Added a dummy Ubuntu 22 and MacOS categories as an example.
This commit is contained in:
2025-02-13 12:29:06 +01:00
parent ab1105b058
commit b7b9fdaea7
3 changed files with 8 additions and 7 deletions
+2
View File
@@ -101,6 +101,7 @@ async def filter_targets(devices: list[dict], os_categories: dict, target_os: st
def get_os_variants(category: str, os_map: dict) -> set:
"""Extracts all OS names under a given category if it exists."""
for key, value in os_map.items():
if key == category:
if isinstance(value, dict): # Expand nested categories
@@ -124,6 +125,7 @@ async def filter_targets(devices: list[dict], os_categories: dict, target_os: st
allowed_os = get_os_variants(target_os, os_categories[key])
break # Stop searching once a match is found
# Filter out unreachable devices
for device in devices:
if not device["reachable"]:
continue # Skip unreachable devices.