From f26a8c3d231f202aa2c468d96971f0d80172f393 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 4 Mar 2024 10:14:37 +0100 Subject: improve missing clients error reporting in multiple commands All the commands that need target clients now have a more descriptive error message when the clients of the command are missing. --- cli/objects/disks.py | 2 +- cli/objects/images.py | 2 +- cli/objects/modes.py | 2 +- cli/objects/poweroff.py | 2 +- cli/objects/reboot.py | 2 +- cli/objects/server.py | 2 +- cli/objects/session.py | 2 +- cli/objects/wol.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cli/objects/disks.py b/cli/objects/disks.py index 6c9847c..c7315af 100644 --- a/cli/objects/disks.py +++ b/cli/objects/disks.py @@ -93,7 +93,7 @@ class OgDisk(): for l in parsed_args.client_ip: ips.add(l) if not ips: - print("No clients found") + print("Missing --client-ip, or --room-id/--center-id. No clients provided.") return None payload = {'clients': parsed_args.client_ip, 'type': disk_type_map[parsed_args.type], 'disk': str(parsed_args.num), diff --git a/cli/objects/images.py b/cli/objects/images.py index 5f4a146..39a7e9f 100644 --- a/cli/objects/images.py +++ b/cli/objects/images.py @@ -79,7 +79,7 @@ class OgImage(): ips.add(l) if not ips: - print('No clients specified.') + print('Missing --client-ip, or --room-id/--center-id. No clients provided.') return r = rest.get('/images') diff --git a/cli/objects/modes.py b/cli/objects/modes.py index 24a436f..7cf78e2 100644 --- a/cli/objects/modes.py +++ b/cli/objects/modes.py @@ -58,7 +58,7 @@ class OgModes(): ips.add(l) if not ips: - print("No clients found") + print("Missing --client-ip, or --room-id/--center-id. No clients provided.") return None payload = {'clients': list(ips), 'mode': parsed_args.mode[0]} diff --git a/cli/objects/poweroff.py b/cli/objects/poweroff.py index c8848c5..af309bf 100644 --- a/cli/objects/poweroff.py +++ b/cli/objects/poweroff.py @@ -50,7 +50,7 @@ class OgPoweroff(): ips.add(l) if not ips: - print("No clients found") + print("Missing --client-ip, or --room-id/--center-id. No clients provided.") return None payload = {'clients': list(ips)} diff --git a/cli/objects/reboot.py b/cli/objects/reboot.py index bfa3257..ca2ee9f 100644 --- a/cli/objects/reboot.py +++ b/cli/objects/reboot.py @@ -50,7 +50,7 @@ class OgReboot(): ips.add(l) if not ips: - print("No clients found") + print("Missing --client-ip, or --room-id/--center-id. No clients provided.") return None payload = {'clients': list(ips)} diff --git a/cli/objects/server.py b/cli/objects/server.py index a564f59..d0b13d0 100644 --- a/cli/objects/server.py +++ b/cli/objects/server.py @@ -71,7 +71,7 @@ class OgServer(): for l in parsed_args.client_ip: ips.add(l) if not ips: - print('No clients specified.') + print('Missing --client-ip or --room-id. No clients provided.') return payload = {'id': parsed_args.id, 'clients': list(ips)} diff --git a/cli/objects/session.py b/cli/objects/session.py index c13468f..0168cb3 100644 --- a/cli/objects/session.py +++ b/cli/objects/session.py @@ -58,7 +58,7 @@ class OgSession(): ips.add(l) if not ips: - print("No clients found") + print("Missing --client-ip, or --room-id/--center-id. No clients provided.") return None payload = { diff --git a/cli/objects/wol.py b/cli/objects/wol.py index b037804..9eba702 100644 --- a/cli/objects/wol.py +++ b/cli/objects/wol.py @@ -67,7 +67,7 @@ class OgWol(): ips.add(l) if not ips: - print("No clients found") + print("Missing --client-ip, or --room-id/--center-id. No clients provided.") return None payload = {'type': parsed_args.type, 'clients': list(ips)} -- cgit v1.2.3-18-g5258