From 1c94ef5c56a9e6cde86c8d888b4dd90321913abe Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Thu, 14 Sep 2017 10:36:32 +0200 Subject: [PATCH] tools: ratbagctl: only warn that no devices are available in list_devices If the other commands try to access a node, there will be an other error ("Unable to find device X"). So there is no points in having this as a global check. For the .devel and .test versions, we are guaranteed to have the test_device at least, so no worries on this side too. Signed-off-by: Benjamin Tissoires --- tools/ratbagctl.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ratbagctl.in b/tools/ratbagctl.in index 8196ba8b..e0988611 100755 --- a/tools/ratbagctl.in +++ b/tools/ratbagctl.in @@ -55,6 +55,9 @@ for k, v in [(v, k) for k, v in button_specials_strmap.items()]: def list_devices(r, args): + if not r.devices: + print("No devices available.") + for d in r.devices: print("{:10s} {:32s}".format(d.id + ":", d.name)) @@ -1445,9 +1448,6 @@ def open_ratbagd(ratbagd_process=None): print("Unable to connect to ratbagd over dbus") return None - if not r.devices: - print("No devices available.") - if ratbagd_process is not None: # if some old version of ratbagd is still running, ratbagd_process may # have never started but our DBus bindings may succeed. Check for the