Small logic change. Added extra check and error handling.

This commit is contained in:
Daan Selen
2025-02-28 14:19:40 +01:00
parent 6f945d30d7
commit 898098105c
2 changed files with 15 additions and 2 deletions

View File

@@ -224,7 +224,6 @@ async def gather_targets(meshbook: dict, group_list: dict[str, list[dict]], os_c
if isinstance(pseudo_target, str):
matched_devices = await process_device_or_group(pseudo_target, group_list, os_categories, target_os)
target_list.extend(matched_devices)
else:
console(text_color.yellow + "Please use devices (Notice the 'S') for multiple devices.", True)
@@ -241,7 +240,8 @@ async def gather_targets(meshbook: dict, group_list: dict[str, list[dict]], os_c
if isinstance(pseudo_target, str) and pseudo_target in group_list:
matched_devices = await filter_targets(group_list[pseudo_target], os_categories, target_os)
target_list.extend(matched_devices)
if pseudo_target not in group_list:
console(text_color.yellow + "Targeted group not found on the MeshCentral server.", True)
else:
console(text_color.yellow + "Please use groups (Notice the 'S') for multiple groups.", True)