mirror of https://git.48k.eu/ogcli/
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
parent
9a11fd8346
commit
f26a8c3d23
|
@ -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),
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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]}
|
||||
|
|
|
@ -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)}
|
||||
|
|
|
@ -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)}
|
||||
|
|
|
@ -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)}
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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)}
|
||||
|
|
Loading…
Reference in New Issue