Browse Source

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(...)).
Marek Marczykowski-Górecki 6 years ago
parent
commit
c87820fba8
3 changed files with 3 additions and 39 deletions
  1. 3 11
      qubesadmin/app.py
  2. 0 21
      qubesadmin/vm/__init__.py
  3. 0 7
      setup.py

+ 3 - 11
qubesadmin/app.py

@@ -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``
-        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
         :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,
     def add_new_vm(self, cls, name, label, template=None, pool=None,
             pools=None):
             pools=None):

+ 0 - 21
qubesadmin/vm/__init__.py

@@ -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
 
 

+ 0 - 7
setup.py

@@ -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',
-            ],
         },
         },
 
 
         )
         )