1
0
Fork 0

tools/debug-control: Handle the service not being exported

This is the default case and we want to tell people how to export it
when they use the script instead of having a python stack trace.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3902>
This commit is contained in:
Sebastian Wick 2024-07-24 22:32:42 +02:00 committed by Marge Bot
parent 682935fefa
commit 788409e094

View file

@ -17,7 +17,13 @@ def bool_to_string(value):
def get_debug_control():
bus = dbus.SessionBus()
return bus.get_object(NAME, OBJECT_PATH)
try:
debug_control = bus.get_object(NAME, OBJECT_PATH)
except dbus.exceptions.DBusException:
print("The DebugControl service is not available.")
print("You may have to enable the `debug-control` flag in looking glass.")
exit(-1)
return debug_control
def status():
debug_control = get_debug_control()