diff options
Diffstat (limited to 'cli/objects/reboot.py')
-rw-r--r-- | cli/objects/reboot.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/objects/reboot.py b/cli/objects/reboot.py index ca2ee9f..4f7f755 100644 --- a/cli/objects/reboot.py +++ b/cli/objects/reboot.py @@ -36,8 +36,8 @@ class OgReboot(): help='Specific client IP') parsed_args = parser.parse_args(args) - r = rest.get('/scopes') - scopes = r.json() + res = rest.get('/scopes') + scopes = res.json() ips = set() for center in parsed_args.center_id: @@ -51,7 +51,10 @@ class OgReboot(): if not ips: print("Missing --client-ip, or --room-id/--center-id. No clients provided.") - return None + return 1 payload = {'clients': list(ips)} - r = rest.post('/reboot', payload=payload) + res = rest.post('/reboot', payload=payload) + if not res: + return 1 + return 0 |