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 import qubesadmin.config
BUF_SIZE = 4096 BUF_SIZE = 4096
VM_ENTRY_POINT = 'qubesadmin.vm'
class VMCollection(object): class VMCollection(object):
'''Collection of VMs objects''' '''Collection of VMs objects'''
@ -220,20 +219,13 @@ class QubesBase(qubesadmin.base.PropertyHolder):
def get_vm_class(clsname): def get_vm_class(clsname):
'''Find the class for a domain. '''Find the class for a domain.
Classes are registered as setuptools' entry points in ``qubes.vm`` Compatibility function, client tools use str to identify domain classes.
group. Any package may supply their own classes.
:param str clsname: name of the class :param str clsname: name of the class
:return type: class :return str: class
''' '''
try: return clsname
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
def add_new_vm(self, cls, name, label, template=None, pool=None, def add_new_vm(self, cls, name, label, template=None, pool=None,
pools=None): pools=None):

View File

@ -339,27 +339,6 @@ class QubesVM(qubesadmin.base.PropertyHolder):
self._klass = super(QubesVM, self).klass self._klass = super(QubesVM, self).klass
return 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): class DispVMWrapper(QubesVM):
'''Wrapper class for new DispVM, supporting only service call '''Wrapper class for new DispVM, supporting only service call

View File

@ -38,13 +38,6 @@ if __name__ == '__main__':
}, },
entry_points={ entry_points={
'console_scripts': list(get_console_scripts()), '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',
],
}, },
) )