mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
tools: don't return a ratbagd_process if things failed
If we couldn't find the name on the bus or the ratbagd process already terminated, return None and fail. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Benjamin Tissoires
parent
572f00cf2a
commit
9f805a4ebe
@@ -39,6 +39,8 @@ def main(argv):
|
||||
argv = ["list"]
|
||||
|
||||
ratbagd_process = toolbox.start_ratbagd()
|
||||
if ratbagd_process is None:
|
||||
sys.exit("Failed to start or connect to ratbagd")
|
||||
|
||||
ratbagd = toolbox.open_ratbagd()
|
||||
parser = toolbox.get_parser()
|
||||
|
||||
@@ -84,6 +84,9 @@ def start_ratbagd():
|
||||
|
||||
os.environ['RATBAGCTL_DEVEL'] = "org.freedesktop.ratbag_devel1_@ratbagd_sha@"
|
||||
|
||||
if name_owner is None or ratbagd_process.poll() is not None:
|
||||
return None
|
||||
|
||||
return ratbagd_process
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user