Skip to content

Commit

Permalink
fix(device): prints error during delete when no devices found
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pallabpain committed Jan 25, 2024
1 parent f73fea0 commit 7bf2c94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions riocli/device/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 7bf2c94

Please sign in to comment.