mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-09 08:58:27 +03:00
Store running_config in util, not config.py
Will help with TUI integration
This commit is contained in:
parent
36040e3f00
commit
90679a0a0b
@ -401,10 +401,11 @@ def main():
|
||||
# doesn't think we closed the app, therefor robbing us of
|
||||
# display access
|
||||
import virtManager.config
|
||||
import virtManager.util
|
||||
config = virtManager.config.vmmConfig(appname, appversion,
|
||||
gconf_dir, glade_dir,
|
||||
icon_dir, data_dir)
|
||||
virtManager.config.running_config = config
|
||||
virtManager.util.running_config = config
|
||||
config.default_qemu_user = default_qemu_user
|
||||
config.enable_unsupported_rhel_opts = rhel_enable_unsupported_opts
|
||||
config.preferred_distros = preferred_distros
|
||||
|
@ -25,7 +25,8 @@ import logging
|
||||
import gtk
|
||||
import gobject
|
||||
|
||||
import virtManager.config
|
||||
import virtManager
|
||||
import virtManager.util as util
|
||||
|
||||
def _safe_wrapper(func, *args):
|
||||
gtk.gdk.threads_enter()
|
||||
@ -42,7 +43,7 @@ class vmmGObject(gobject.GObject):
|
||||
|
||||
def __init__(self):
|
||||
gobject.GObject.__init__(self)
|
||||
self.config = virtManager.config.running_config
|
||||
self.config = util.running_config
|
||||
|
||||
self._gobject_handles = []
|
||||
self._gobject_timeouts = []
|
||||
|
@ -29,8 +29,6 @@ import virtinst
|
||||
from virtManager.keyring import vmmKeyring
|
||||
from virtManager.secret import vmmSecret
|
||||
|
||||
running_config = None
|
||||
|
||||
class vmmConfig(object):
|
||||
|
||||
# GConf directory names for saving last used paths
|
||||
|
@ -30,7 +30,6 @@ from virtinst import VirtualDisk
|
||||
|
||||
from virtManager import util
|
||||
from virtManager.error import vmmErrorDialog
|
||||
from virtManager.config import running_config
|
||||
|
||||
OPTICAL_DEV_PATH = 0
|
||||
OPTICAL_LABEL = 1
|
||||
@ -703,7 +702,7 @@ def mediadev_set_default_selection(widget):
|
||||
|
||||
def build_shutdown_button_menu(widget, shutdown_cb, reboot_cb,
|
||||
destroy_cb, save_cb):
|
||||
icon_name = running_config.get_shutdown_icon_name()
|
||||
icon_name = util.running_config.get_shutdown_icon_name()
|
||||
widget.set_icon_name(icon_name)
|
||||
menu = gtk.Menu()
|
||||
widget.set_menu(menu)
|
||||
@ -750,9 +749,9 @@ def check_path_search_for_qemu(parent, conn, path):
|
||||
if conn.is_remote() or not conn.is_qemu_system():
|
||||
return
|
||||
|
||||
user = running_config.default_qemu_user
|
||||
user = util.running_config.default_qemu_user
|
||||
|
||||
skip_paths = running_config.get_perms_fix_ignore()
|
||||
skip_paths = util.running_config.get_perms_fix_ignore()
|
||||
broken_paths = VirtualDisk.check_path_search_for_user(conn.vmm, path, user)
|
||||
for p in broken_paths:
|
||||
if p in skip_paths:
|
||||
@ -770,7 +769,7 @@ def check_path_search_for_qemu(parent, conn, path):
|
||||
buttons=gtk.BUTTONS_YES_NO)
|
||||
|
||||
if chkres:
|
||||
running_config.add_perms_fix_ignore(broken_paths)
|
||||
util.running_config.add_perms_fix_ignore(broken_paths)
|
||||
if not resp:
|
||||
return
|
||||
|
||||
@ -793,7 +792,7 @@ def check_path_search_for_qemu(parent, conn, path):
|
||||
_("Don't ask about these directories again."))
|
||||
|
||||
if chkres:
|
||||
running_config.add_perms_fix_ignore(errors.keys())
|
||||
util.running_config.add_perms_fix_ignore(errors.keys())
|
||||
|
||||
######################################
|
||||
# Interface startmode widget builder #
|
||||
|
@ -24,10 +24,11 @@ import libxml2
|
||||
import logging
|
||||
import os.path
|
||||
|
||||
from virtManager.config import running_config
|
||||
import virtManager
|
||||
import virtinst
|
||||
|
||||
running_config = None
|
||||
|
||||
# FIXME: selinux policy also has a ~/VirtualMachines/isos dir
|
||||
def get_default_pool_path(conn):
|
||||
if conn.is_session_uri():
|
||||
|
Loading…
x
Reference in New Issue
Block a user