config: eliminate duplicated qubes_base_dir
Remove it from system_path dict, have it in one place.
This commit is contained in:
parent
317d140f46
commit
075d991114
@ -724,7 +724,7 @@ class Qubes(qubes.PropertyHolder):
|
|||||||
else:
|
else:
|
||||||
self._store = os.environ.get('QUBES_XML_PATH',
|
self._store = os.environ.get('QUBES_XML_PATH',
|
||||||
os.path.join(
|
os.path.join(
|
||||||
qubes.config.system_path['qubes_base_dir'],
|
qubes.config.qubes_base_dir,
|
||||||
qubes.config.system_path['qubes_store_filename']))
|
qubes.config.system_path['qubes_store_filename']))
|
||||||
|
|
||||||
super(Qubes, self).__init__(xml=None, **kwargs)
|
super(Qubes, self).__init__(xml=None, **kwargs)
|
||||||
|
@ -36,8 +36,6 @@ system_path = {
|
|||||||
'qrexec_client_path': '/usr/lib/qubes/qrexec-client',
|
'qrexec_client_path': '/usr/lib/qubes/qrexec-client',
|
||||||
'qubesdb_daemon_path': '/usr/sbin/qubesdb-daemon',
|
'qubesdb_daemon_path': '/usr/sbin/qubesdb-daemon',
|
||||||
|
|
||||||
'qubes_base_dir': qubes_base_dir,
|
|
||||||
|
|
||||||
# Relative to qubes_base_dir
|
# Relative to qubes_base_dir
|
||||||
'qubes_appvms_dir': 'appvms',
|
'qubes_appvms_dir': 'appvms',
|
||||||
'qubes_templates_dir': 'vm-templates',
|
'qubes_templates_dir': 'vm-templates',
|
||||||
|
@ -583,7 +583,7 @@ class SystemTestsMixin(object):
|
|||||||
# need some information from the real qubes.xml - at least installed
|
# need some information from the real qubes.xml - at least installed
|
||||||
# templates; should not be used for testing, only to initialize self.app
|
# templates; should not be used for testing, only to initialize self.app
|
||||||
self.host_app = qubes.Qubes(os.path.join(
|
self.host_app = qubes.Qubes(os.path.join(
|
||||||
qubes.config.system_path['qubes_base_dir'],
|
qubes.config.qubes_base_dir,
|
||||||
qubes.config.system_path['qubes_store_filename']))
|
qubes.config.system_path['qubes_store_filename']))
|
||||||
if os.path.exists(CLASS_XMLPATH):
|
if os.path.exists(CLASS_XMLPATH):
|
||||||
shutil.copy(CLASS_XMLPATH, XMLPATH)
|
shutil.copy(CLASS_XMLPATH, XMLPATH)
|
||||||
@ -727,7 +727,7 @@ class SystemTestsMixin(object):
|
|||||||
'qubes_appvms_dir',
|
'qubes_appvms_dir',
|
||||||
'qubes_servicevms_dir',
|
'qubes_servicevms_dir',
|
||||||
'qubes_templates_dir'):
|
'qubes_templates_dir'):
|
||||||
dirpath = os.path.join(qubes.config.system_path['qubes_base_dir'],
|
dirpath = os.path.join(qubes.config.qubes_base_dir,
|
||||||
qubes.config.system_path[dirspec], vmname)
|
qubes.config.system_path[dirspec], vmname)
|
||||||
if os.path.exists(dirpath):
|
if os.path.exists(dirpath):
|
||||||
if os.path.isdir(dirpath):
|
if os.path.isdir(dirpath):
|
||||||
@ -791,7 +791,7 @@ class SystemTestsMixin(object):
|
|||||||
'qubes_appvms_dir',
|
'qubes_appvms_dir',
|
||||||
'qubes_servicevms_dir',
|
'qubes_servicevms_dir',
|
||||||
'qubes_templates_dir'):
|
'qubes_templates_dir'):
|
||||||
dirpath = os.path.join(qubes.config.system_path['qubes_base_dir'],
|
dirpath = os.path.join(qubes.config.qubes_base_dir,
|
||||||
qubes.config.system_path[dirspec])
|
qubes.config.system_path[dirspec])
|
||||||
for name in os.listdir(dirpath):
|
for name in os.listdir(dirpath):
|
||||||
if name.startswith(prefix):
|
if name.startswith(prefix):
|
||||||
|
@ -306,8 +306,8 @@ class TC_03_FilePool(qubes.tests.QubesTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
""" Add a test file based storage pool """
|
""" Add a test file based storage pool """
|
||||||
super(TC_03_FilePool, self).setUp()
|
super(TC_03_FilePool, self).setUp()
|
||||||
self._orig_qubes_base_dir = qubes.config.system_path['qubes_base_dir']
|
self._orig_qubes_base_dir = qubes.config.qubes_base_dir
|
||||||
qubes.config.system_path['qubes_base_dir'] = '/tmp/qubes-test'
|
qubes.config.qubes_base_dir = '/tmp/qubes-test'
|
||||||
self.app = TestApp()
|
self.app = TestApp()
|
||||||
self.app.create_dummy_template()
|
self.app.create_dummy_template()
|
||||||
self.app.add_pool(**self.POOL_CONFIG)
|
self.app.add_pool(**self.POOL_CONFIG)
|
||||||
@ -320,7 +320,7 @@ class TC_03_FilePool(qubes.tests.QubesTestCase):
|
|||||||
shutil.rmtree(self.POOL_DIR, ignore_errors=True)
|
shutil.rmtree(self.POOL_DIR, ignore_errors=True)
|
||||||
if os.path.exists('/tmp/qubes-test'):
|
if os.path.exists('/tmp/qubes-test'):
|
||||||
shutil.rmtree('/tmp/qubes-test')
|
shutil.rmtree('/tmp/qubes-test')
|
||||||
qubes.config.system_path['qubes_base_dir'] = self._orig_qubes_base_dir
|
qubes.config.qubes_base_dir = self._orig_qubes_base_dir
|
||||||
|
|
||||||
def test_001_pool_exists(self):
|
def test_001_pool_exists(self):
|
||||||
""" Check if the storage pool was added to the storage pool config """
|
""" Check if the storage pool was added to the storage pool config """
|
||||||
|
@ -577,7 +577,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
def dir_path(self):
|
def dir_path(self):
|
||||||
'''Root directory for files related to this domain'''
|
'''Root directory for files related to this domain'''
|
||||||
return os.path.join(
|
return os.path.join(
|
||||||
qubes.config.system_path['qubes_base_dir'],
|
qubes.config.qubes_base_dir,
|
||||||
self.dir_path_prefix,
|
self.dir_path_prefix,
|
||||||
self.name)
|
self.name)
|
||||||
|
|
||||||
@ -716,7 +716,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
if not newvalue:
|
if not newvalue:
|
||||||
return
|
return
|
||||||
dirname = os.path.join(
|
dirname = os.path.join(
|
||||||
qubes.config.system_path['qubes_base_dir'],
|
qubes.config.qubes_base_dir,
|
||||||
qubes.config.system_path['qubes_kernels_base_dir'],
|
qubes.config.system_path['qubes_kernels_base_dir'],
|
||||||
newvalue)
|
newvalue)
|
||||||
if not os.path.exists(dirname):
|
if not os.path.exists(dirname):
|
||||||
|
Loading…
Reference in New Issue
Block a user