Drop individual VM classes as python types completely

Since those are unused now, remove them from the source, so it is easier
to debug the code (avoid never matching isinstance(...)).
This commit is contained in:
Marek Marczykowski-Górecki 2017-10-02 21:09:43 +02:00
parent b55f615942
commit c87820fba8
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
3 changed files with 3 additions and 39 deletions

View File

@ -38,7 +38,6 @@ import qubesadmin.vm
import qubesadmin.config
BUF_SIZE = 4096
VM_ENTRY_POINT = 'qubesadmin.vm'
class VMCollection(object):
'''Collection of VMs objects'''
@ -220,20 +219,13 @@ class QubesBase(qubesadmin.base.PropertyHolder):
def get_vm_class(clsname):
'''Find the class for a domain.
Classes are registered as setuptools' entry points in ``qubes.vm``
group. Any package may supply their own classes.
Compatibility function, client tools use str to identify domain classes.
:param str clsname: name of the class
:return type: class
:return str: class
'''
try:
return qubesadmin.utils.get_entry_point_one(
VM_ENTRY_POINT, clsname)
except KeyError:
raise qubesadmin.exc.QubesException(
'no such VM class: {!r}'.format(clsname))
# don't catch TypeError
return clsname
def add_new_vm(self, cls, name, label, template=None, pool=None,
pools=None):

View File

@ -339,27 +339,6 @@ class QubesVM(qubesadmin.base.PropertyHolder):
self._klass = super(QubesVM, self).klass
return self._klass
# pylint: disable=abstract-method
class AdminVM(QubesVM):
'''Dom0'''
pass
class AppVM(QubesVM):
'''Application VM'''
pass
class StandaloneVM(QubesVM):
'''Standalone Application VM'''
pass
class TemplateVM(QubesVM):
'''Template for AppVM'''
pass
class DispVMWrapper(QubesVM):
'''Wrapper class for new DispVM, supporting only service call

View File

@ -38,13 +38,6 @@ if __name__ == '__main__':
},
entry_points={
'console_scripts': list(get_console_scripts()),
'qubesadmin.vm': [
'AppVM = qubesadmin.vm:AppVM',
'TemplateVM = qubesadmin.vm:TemplateVM',
'StandaloneVM = qubesadmin.vm:StandaloneVM',
'AdminVM = qubesadmin.vm:AdminVM',
'DispVM = qubesadmin.vm:DispVM',
],
},
)