From 9c4c1e84aaeb539e6a5159130c1e85a6e04c98ce Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 31 May 2014 16:28:58 -0400 Subject: [PATCH] cliconfig: Better error if glib-compile-schemas is not available --- virtcli/cliconfig.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/virtcli/cliconfig.py b/virtcli/cliconfig.py index 8aa24b2b..64302d1b 100644 --- a/virtcli/cliconfig.py +++ b/virtcli/cliconfig.py @@ -53,9 +53,15 @@ def _setup_gsettings_path(schemadir): schema and use it directly """ import subprocess + from distutils.spawn import find_executable + + exe = find_executable("glib-compile-schemas") + if not exe: + raise RuntimeError("You must install glib-compile-schemas to run " + "virt-manager from git.") os.environ["GSETTINGS_SCHEMA_DIR"] = schemadir - ret = subprocess.call(["glib-compile-schemas", "--strict", schemadir]) + ret = subprocess.call([exe, "--strict", schemadir]) if ret != 0: raise RuntimeError("Failed to compile local gsettings schemas")