From 8ff2323a1bc45607e1359f7685955140e9267dfc Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 10 Oct 2023 12:03:30 +0200 Subject: [PATCH] Start moving VM related methods from lib/cr_vmware_tpl/handler/__init__.py into lib/cr_vmware_tpl/handler/vm.py --- lib/cr_vmware_tpl/handler/__init__.py | 6 ++-- lib/cr_vmware_tpl/handler/vm.py | 46 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 lib/cr_vmware_tpl/handler/vm.py diff --git a/lib/cr_vmware_tpl/handler/__init__.py b/lib/cr_vmware_tpl/handler/__init__.py index f0c2eb6..ead8b1c 100644 --- a/lib/cr_vmware_tpl/handler/__init__.py +++ b/lib/cr_vmware_tpl/handler/__init__.py @@ -42,6 +42,7 @@ from .. import print_section_start, print_section_end from .cobbler import HandlerCobblerMixin from .ldap import HandlerLdapMixin +from .vm import HandlerVmMixin from .vmware import HandlerVmwareMixin from ..config import CrTplConfiguration @@ -50,7 +51,7 @@ from ..cobbler import Cobbler from ..xlate import XLATOR -__version__ = '2.4.5' +__version__ = '2.4.6' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -59,7 +60,8 @@ _ = XLATOR.gettext ngettext = XLATOR.ngettext # ============================================================================= -class CrTplHandler(BaseHandler, HandlerLdapMixin, HandlerCobblerMixin, HandlerVmwareMixin): +class CrTplHandler( + BaseHandler, HandlerLdapMixin, HandlerCobblerMixin, HandlerVmMixin, HandlerVmwareMixin): """ A handler class for creating a vSphere template. """ diff --git a/lib/cr_vmware_tpl/handler/vm.py b/lib/cr_vmware_tpl/handler/vm.py new file mode 100644 index 0000000..c322226 --- /dev/null +++ b/lib/cr_vmware_tpl/handler/vm.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +@author: Frank Brehm +@contact: frank.brehm@pixelpark.com +@copyright: © 2023 by Frank Brehm, Berlin +@summary: A mixin module for the CrTplHandler class for VM dependend methods. +""" +from __future__ import absolute_import, print_function + +# Standard modules +import logging + +# Third party modules +# from fb_tools.common import pp +# from fb_tools.errors import HandlerError, ExpectedHandlerError + +# Own modules + +# from .. import print_section_start, print_section_end +from ..xlate import XLATOR + +__version__ = '0.1.0' + +LOG = logging.getLogger(__name__) + +_ = XLATOR.gettext +ngettext = XLATOR.ngettext + +# ============================================================================= +class HandlerVmMixin(): + """ + A mixin class for extending the CrTplHandler class for VMware/VSphere dependend methods. + """ + + pass + + +# ============================================================================= +if __name__ == "__main__": + + pass + +# ============================================================================= + +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 list -- 2.39.5