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.
master
Alejandro Sirgo Rica 2024-03-04 10:14:37 +01:00
parent 9a11fd8346
commit f26a8c3d23
8 changed files with 8 additions and 8 deletions

View File

@ -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),

View File

@ -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')

View File

@ -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]}

View File

@ -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)}

View File

@ -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)}

View File

@ -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)}

View File

@ -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 = {

View File

@ -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)}