]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Start moving Cobbler related methods from lib/cr_vmware_tpl/handler/__init__.py into...
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 10 Oct 2023 08:58:06 +0000 (10:58 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 10 Oct 2023 08:58:06 +0000 (10:58 +0200)
lib/cr_vmware_tpl/handler/__init__.py
lib/cr_vmware_tpl/handler/cobbler.py [new file with mode: 0644]

index 064e68c838ff47ce410a12e23a6283653aec92c6..8446291fbec6c8c6be3f50d8801fee7b2a21fd54 100644 (file)
@@ -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 (file)
index 0000000..a3c2218
--- /dev/null
@@ -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