virt-manager: fix git startup on wayland

Apparently we need to do these env settings much earlier...
This commit is contained in:
Cole Robinson 2018-03-17 12:05:42 -04:00
parent 483a8de6c1
commit 7ad15769dc
2 changed files with 7 additions and 7 deletions

View File

@ -197,6 +197,11 @@ def main():
import libvirt
virtManager.module_trace.wrap_module(libvirt, regex=None)
# With F27 gnome+wayland we need to set these before GTK import
os.environ["GSETTINGS_SCHEMA_DIR"] = CLIConfig.gsettings_dir
if options.test_first_run:
os.environ["GSETTINGS_BACKEND"] = "memory"
# Now we've got basic environment up & running we can fork
do_drop_stdio = False
if not options.no_fork and not options.debug:

View File

@ -37,12 +37,8 @@ class _SettingsWrapper(object):
we internally convert it to the settings nested hierarchy. Makes
client code much smaller.
"""
def __init__(self, settings_id, schemadir, test_first_run):
def __init__(self, settings_id):
self._root = settings_id
os.environ["GSETTINGS_SCHEMA_DIR"] = schemadir
if test_first_run:
os.environ["GSETTINGS_BACKEND"] = "memory"
self._settings = Gio.Settings.new(self._root)
self._settingsmap = {"": self._settings}
@ -185,8 +181,7 @@ class vmmConfig(object):
self.test_first_run = bool(test_first_run)
self.test_leak_debug = False
self.conf = _SettingsWrapper("org.virt-manager.virt-manager",
CLIConfig.gsettings_dir, self.test_first_run)
self.conf = _SettingsWrapper("org.virt-manager.virt-manager")
# We don't create it straight away, since we don't want
# to block the app pending user authorization to access