Remove QubesVM.is_netvm() and is_disposablevm()
This commit is contained in:
parent
4a0b7585d1
commit
b584d1a4bb
@ -1944,10 +1944,10 @@ class BackupRestore(object):
|
|||||||
"qid": {"func": "vm.qid"},
|
"qid": {"func": "vm.qid"},
|
||||||
|
|
||||||
"name": {"func": "('[' if isinstance(vm, qubes.vm.templatevm.TemplateVM) else '')\
|
"name": {"func": "('[' if isinstance(vm, qubes.vm.templatevm.TemplateVM) else '')\
|
||||||
+ ('{' if vm.is_netvm() else '')\
|
+ ('{' if vm.provides_network else '')\
|
||||||
+ vm.name \
|
+ vm.name \
|
||||||
+ (']' if isinstance(vm, qubes.vm.templatevm.TemplateVM) else '')\
|
+ (']' if isinstance(vm, qubes.vm.templatevm.TemplateVM) else '')\
|
||||||
+ ('}' if vm.is_netvm() else '')"},
|
+ ('}' if vm.provides_network else '')"},
|
||||||
|
|
||||||
"type": {"func": "'Tpl' if isinstance(vm, qubes.vm.templatevm.TemplateVM) else \
|
"type": {"func": "'Tpl' if isinstance(vm, qubes.vm.templatevm.TemplateVM) else \
|
||||||
'App' if isinstance(vm, qubes.vm.appvm.AppVM) else \
|
'App' if isinstance(vm, qubes.vm.appvm.AppVM) else \
|
||||||
@ -1958,7 +1958,7 @@ class BackupRestore(object):
|
|||||||
"template": {"func": "'n/a' if not hasattr(vm, 'template') is None "
|
"template": {"func": "'n/a' if not hasattr(vm, 'template') is None "
|
||||||
"else vm_info.template"},
|
"else vm_info.template"},
|
||||||
|
|
||||||
"netvm": {"func": "'n/a' if vm.is_netvm() else\
|
"netvm": {"func": "'n/a' if vm.provides_network else\
|
||||||
('*' if vm.property_is_default('netvm') else '') +\
|
('*' if vm.property_is_default('netvm') else '') +\
|
||||||
vm_info.netvm if vm_info.netvm is not None "
|
vm_info.netvm if vm_info.netvm is not None "
|
||||||
"else '-'"},
|
"else '-'"},
|
||||||
|
@ -212,10 +212,10 @@ class FilePool(Pool):
|
|||||||
are stored
|
are stored
|
||||||
"""
|
"""
|
||||||
# FIX Remove this if we drop the file backend
|
# FIX Remove this if we drop the file backend
|
||||||
import qubes.vm.templatevm # nopep8
|
import qubes.vm # nopep8
|
||||||
if isinstance(vm, qubes.vm.templatevm.TemplateVM):
|
if isinstance(vm, qubes.vm.templatevm.TemplateVM):
|
||||||
subdir = 'vm-templates'
|
subdir = 'vm-templates'
|
||||||
elif vm.is_disposablevm():
|
elif isinstance(vm, qubes.vm.dispvm.DispVM):
|
||||||
subdir = 'appvms'
|
subdir = 'appvms'
|
||||||
return os.path.join(self.dir_path, subdir,
|
return os.path.join(self.dir_path, subdir,
|
||||||
vm.template.name + '-dvm')
|
vm.template.name + '-dvm')
|
||||||
|
@ -385,19 +385,6 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
def conf_file(self):
|
def conf_file(self):
|
||||||
return os.path.join(self.dir_path, 'libvirt.xml')
|
return os.path.join(self.dir_path, 'libvirt.xml')
|
||||||
|
|
||||||
# XXX I don't know what to do with these; probably should be isinstance(...)
|
|
||||||
def is_disposablevm(self):
|
|
||||||
warnings.warn('vm.is_disposable() is deprecated, use isinstance()',
|
|
||||||
DeprecationWarning)
|
|
||||||
import qubes.vm.dispvm # pylint: disable=redefined-outer-name
|
|
||||||
return isinstance(self, qubes.vm.dispvm.DispVM)
|
|
||||||
|
|
||||||
def is_netvm(self):
|
|
||||||
warnings.warn('vm.is_netvm() is deprecated, use isinstance()',
|
|
||||||
DeprecationWarning)
|
|
||||||
return isinstance(self, qubes.vm.mix.net.NetVMMixin) \
|
|
||||||
and self.provides_network
|
|
||||||
|
|
||||||
# network-related
|
# network-related
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user