From 7bf2c944bd9c03ef3d6c79c6022c00b210c2c8b8 Mon Sep 17 00:00:00 2001 From: Pallab Pain Date: Thu, 25 Jan 2024 16:39:46 +0530 Subject: [PATCH] fix(device): prints error during delete when no devices found This commit fixes the bug in the rio device delete command when no devices are found and the command prints "Nothing to delete" and returns a zero exit code. While this was mostly okay, it's not script friendly or automation friendly. This commit fixes the bug. --- riocli/device/delete.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/riocli/device/delete.py b/riocli/device/delete.py index 138c49fa..2d1d2be0 100644 --- a/riocli/device/delete.py +++ b/riocli/device/delete.py @@ -69,9 +69,9 @@ def delete_device( raise SystemExit(1) from e if not devices: - spinner.text = "No devices to delete" - spinner.ok(Symbols.SUCCESS) - return + spinner.text = click.style("Device(s) not found", Colors.RED) + spinner.red.fail(Symbols.ERROR) + raise SystemExit(1) headers = ['Name', 'Device ID', 'Status'] data = [[d.name, d.uuid, d.status] for d in devices]