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:
parent
682935fefa
commit
788409e094
1 changed files with 7 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue