]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Start integrating lib/cr_vmware_tpl/cobbler.py into lib/cr_vmware_tpl/handler.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 27 May 2020 13:33:40 +0000 (15:33 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 27 May 2020 13:33:40 +0000 (15:33 +0200)
lib/cr_vmware_tpl/cobbler.py
lib/cr_vmware_tpl/handler.py

index b7fe2750baf36f39714072077faeb3b7a3d9938d..307b0083a21876cad45bc3c7e6cc1a8e1a948656 100644 (file)
@@ -27,7 +27,7 @@ from .config import CrTplConfiguration
 
 from .xlate import XLATOR
 
-__version__ = '0.0.1'
+__version__ = '0.1.1'
 
 LOG = logging.getLogger(__name__)
 
index d02f337bfdcf46f5591a715c3560e1e86db76d58..375554a46bf9e442bde9570f3e88cd1c99facbda 100644 (file)
@@ -36,9 +36,11 @@ from fb_tools.vsphere.iface import VsphereVmInterface
 
 from .config import CrTplConfiguration
 
+from .cobbler import CobblerError, Cobbler
+
 from .xlate import XLATOR
 
-__version__ = '1.3.2'
+__version__ = '1.4.1'
 
 LOG = logging.getLogger(__name__)
 TZ = pytz.timezone('Europe/Berlin')
@@ -84,6 +86,11 @@ class CrTplHandler(BaseHandler):
             force=force, initialized=False,
         )
 
+        if not isinstance(config, CrTplConfiguration):
+            msg = _("{w} is not an instance of {c}, but an instance of {i} instead.").format(
+                w='Parameter config', c='CrTplConfiguration', i=config.__class__.__name__)
+            raise HandlerError(msg)
+
         self.config = config
         self.service_instance = None
         self.tpl_vm_folder = None
@@ -102,6 +109,7 @@ class CrTplHandler(BaseHandler):
         self.rotate_only = False
         self.abort = False
         self.postinstall_errors = None
+        self.cobbler = None
 
         self.vsphere = VsphereServer(
             appname=self.appname, verbose=self.verbose, base_dir=self.base_dir,
@@ -159,6 +167,8 @@ class CrTplHandler(BaseHandler):
 
         LOG.debug(_("Starting handling ..."))
 
+        return 0
+
         self.vsphere.get_about()
         self.vsphere.get_clusters()
         self.cluster = self.vsphere.get_cluster_by_name(self.config.vsphere_cluster)