[elbe-devel] [PATCH 08/10] elbepack: initvmaction: drop unnecessary constructors
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Mon Apr 22 18:37:29 CEST 2024
The explicit constructors do the same as the implicit ones.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/initvmaction.py | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index a5caa8fec853..bba70e3acfbc 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -46,8 +46,7 @@ def ensure_outdir(opt):
class InitVMError(Exception):
- def __init__(self, msg):
- Exception.__init__(self, msg)
+ pass
class InitVMAction:
@@ -209,9 +208,6 @@ def check_initvm_dir(initvmdir):
@InitVMAction.register('start')
class StartAction(InitVMAction):
- def __init__(self, node, qemu_mode=False):
- InitVMAction.__init__(self, node, qemu_mode=qemu_mode)
-
def _attach_disk_fds(self):
# libvirt does not necessarily have permissions to directly access the
# image file. libvirt 9.0 provides FDAssociate() to pass an open file
@@ -292,9 +288,6 @@ class StartAction(InitVMAction):
@InitVMAction.register('ensure')
class EnsureAction(InitVMAction):
- def __init__(self, node, qemu_mode=False):
- InitVMAction.__init__(self, node, qemu_mode=qemu_mode)
-
def execute(self, _initvmdir, opt, _args):
# initvm might be running on a different host, thus skipping
@@ -323,9 +316,6 @@ class EnsureAction(InitVMAction):
@InitVMAction.register('stop')
class StopAction(InitVMAction):
- def __init__(self, node, qemu_mode=False):
- InitVMAction.__init__(self, node, qemu_mode=qemu_mode)
-
def _stop_qemu_vm(self, initvmdir):
"""
Stop the QEMU initvm.
@@ -392,9 +382,6 @@ class StopAction(InitVMAction):
@InitVMAction.register('attach')
class AttachAction(InitVMAction):
- def __init__(self, node, qemu_mode=False):
- InitVMAction.__init__(self, node, qemu_mode=qemu_mode)
-
def _attach_qemu_vm(self, initvmdir):
"""
Attach to QEMU initvm.
@@ -830,9 +817,6 @@ class CreateAction(InitVMAction):
@InitVMAction.register('submit')
class SubmitAction(InitVMAction):
- def __init__(self, node, qemu_mode=False):
- InitVMAction.__init__(self, node, qemu_mode=qemu_mode)
-
def execute(self, initvmdir, opt, args):
# In case of QEMU mode, we need to forward the additional parameters.
additional_params = []
@@ -871,9 +855,6 @@ class SubmitAction(InitVMAction):
@InitVMAction.register('sync')
class SyncAction(InitVMAction):
- def __init__(self, node, qemu_mode=False):
- super(SyncAction, self).__init__(node, qemu_mode=qemu_mode)
-
def execute(self, _initvmdir, _opt, _args):
top_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
excludes = ['.git*', '*.pyc', 'elbe-build*', 'initvm', '__pycache__', 'docs', 'examples']
--
2.44.0
More information about the elbe-devel
mailing list