From 95a13f895c41c3d10b6e12200e4b619ecc9879ef Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 10 Oct 2023 10:58:06 +0200 Subject: [PATCH] Start moving Cobbler related methods from lib/cr_vmware_tpl/handler/__init__.py into lib/cr_vmware_tpl/handler/cobbler.py --- lib/cr_vmware_tpl/handler/__init__.py | 5 +-- lib/cr_vmware_tpl/handler/cobbler.py | 48 +++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 lib/cr_vmware_tpl/handler/cobbler.py diff --git a/lib/cr_vmware_tpl/handler/__init__.py b/lib/cr_vmware_tpl/handler/__init__.py index 064e68c..8446291 100644 --- a/lib/cr_vmware_tpl/handler/__init__.py +++ b/lib/cr_vmware_tpl/handler/__init__.py @@ -47,6 +47,7 @@ from fb_vmware.datastore import VsphereDatastore from .. import print_section_start, print_section_end +from .cobbler import HandlerCobblerMixin from .ldap import HandlerLdapMixin from ..config import CrTplConfiguration @@ -57,7 +58,7 @@ from ..errors import MSG_NO_CLUSTER, TempVmExistsError, NoDatastoreFoundError from ..xlate import XLATOR -__version__ = '2.4.1' +__version__ = '2.4.2' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -66,7 +67,7 @@ _ = XLATOR.gettext ngettext = XLATOR.ngettext # ============================================================================= -class CrTplHandler(BaseHandler, HandlerLdapMixin): +class CrTplHandler(BaseHandler, HandlerLdapMixin, HandlerCobblerMixin): """ A handler class for creating a vSphere template. """ diff --git a/lib/cr_vmware_tpl/handler/cobbler.py b/lib/cr_vmware_tpl/handler/cobbler.py new file mode 100644 index 0000000..a3c2218 --- /dev/null +++ b/lib/cr_vmware_tpl/handler/cobbler.py @@ -0,0 +1,48 @@ +#!/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 Cobbler dependend methods. +""" +from __future__ import absolute_import, print_function + +# Standard modules +import logging + +# Third party modules + +from fb_tools.common import pp, is_sequence +from fb_tools.errors import HandlerError + +# 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 HandlerCobblerMixin(): + """ + A mixin class for extending the CrTplHandler class for Cobbler dependend methods. + """ + + pass + + +# ============================================================================= +if __name__ == "__main__": + + pass + +# ============================================================================= + +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 list -- 2.39.5