mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-24 15:26:36 -06:00
cliconfig: Use default values if we're in the test suite
We were doing this by hand more or less, but this way is more future proof.
This commit is contained in:
parent
18d8512699
commit
c136fde04d
@ -20,12 +20,14 @@ import logging
|
||||
import os
|
||||
|
||||
os.environ["VIRTINST_TEST_TRACKPROPS"] = "1"
|
||||
os.environ["VIRTINST_TEST_SUITE"] = "1"
|
||||
|
||||
import virtinst
|
||||
virtinst.enable_rhel_defaults = False
|
||||
|
||||
from virtcli import cliconfig
|
||||
cliconfig.default_graphics = "vnc"
|
||||
# This sets all the cli bits back to their defaults
|
||||
reload(cliconfig)
|
||||
|
||||
from tests import utils
|
||||
|
||||
|
@ -43,7 +43,6 @@ urikvm = uriqemu + _capsprefix + "libvirt-1.1.2-qemu-caps.xml"
|
||||
urilxc = fakeuri + _capsprefix + "capabilities-lxc.xml,lxc"
|
||||
|
||||
os.environ["VIRTINST_TEST_SCRATCHDIR"] = os.getcwd()
|
||||
os.environ["VIRTINST_TEST_SUITE"] = "1"
|
||||
|
||||
|
||||
def get_debug():
|
||||
|
@ -29,6 +29,7 @@ cfg = ConfigParser.ConfigParser()
|
||||
_filepath = os.path.abspath(__file__)
|
||||
_srcdir = os.path.abspath(os.path.join(os.path.dirname(_filepath), ".."))
|
||||
cfgpath = os.path.join(os.path.dirname(_filepath), "cli.cfg")
|
||||
_istest = "VIRTINST_TEST_SUITE" in os.environ
|
||||
if os.path.exists(cfgpath):
|
||||
cfg.read(cfgpath)
|
||||
|
||||
@ -38,7 +39,7 @@ def _split_list(commastr):
|
||||
|
||||
|
||||
def _get_param(name, default):
|
||||
if not cfg.sections():
|
||||
if _istest or not cfg.sections():
|
||||
return default
|
||||
return cfg.get("config", name)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user