diff options
Diffstat (limited to 'cli/objects/poweroff.py')
-rw-r--r-- | cli/objects/poweroff.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/objects/poweroff.py b/cli/objects/poweroff.py index af309bf..ab14b0d 100644 --- a/cli/objects/poweroff.py +++ b/cli/objects/poweroff.py @@ -36,8 +36,8 @@ class OgPoweroff(): 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 OgPoweroff(): 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('/poweroff', payload=payload) + res = rest.post('/poweroff', payload=payload) + if not res: + return 1 + return 0 |