Fix circular deps workaround in Pool.vmdir_path()
This commit is contained in:
parent
85421e3f48
commit
f5cef35cdf
@ -382,22 +382,17 @@ class Pool(object):
|
|||||||
string (str) absolute path to the directory where the vm files
|
string (str) absolute path to the directory where the vm files
|
||||||
are stored
|
are stored
|
||||||
"""
|
"""
|
||||||
# TODO: This is a hack, circular dependencies problem?
|
if vm.is_appvm():
|
||||||
from qubes.qubes import (QubesAppVm, QubesDisposableVm, QubesHVm,
|
|
||||||
QubesNetVm, QubesTemplateHVm, QubesTemplateVm)
|
|
||||||
vm_type = type(vm)
|
|
||||||
|
|
||||||
if vm_type in [QubesAppVm, QubesHVm]:
|
|
||||||
subdir = 'appvms'
|
subdir = 'appvms'
|
||||||
elif vm_type in [QubesTemplateVm, QubesTemplateHVm]:
|
elif vm.is_template():
|
||||||
subdir = 'vm-templates'
|
subdir = 'vm-templates'
|
||||||
elif issubclass(vm_type, QubesNetVm):
|
elif vm.is_netvm():
|
||||||
subdir = 'servicevms'
|
subdir = 'servicevms'
|
||||||
elif vm_type is QubesDisposableVm:
|
elif vm.is_disposablevm():
|
||||||
subdir = 'appvms'
|
subdir = 'appvms'
|
||||||
return os.path.join(pool_dir, subdir, vm.template.name + '-dvm')
|
return os.path.join(pool_dir, subdir, vm.template.name + '-dvm')
|
||||||
else:
|
else:
|
||||||
raise QubesException(str(vm_type) + ' unknown vm type')
|
raise QubesException(vm.type() + ' unknown vm type')
|
||||||
|
|
||||||
return os.path.join(pool_dir, subdir, vm.name)
|
return os.path.join(pool_dir, subdir, vm.name)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user