From: Frank Brehm Date: Wed, 27 May 2020 13:33:40 +0000 (+0200) Subject: Start integrating lib/cr_vmware_tpl/cobbler.py into lib/cr_vmware_tpl/handler.py X-Git-Tag: 2.1.2^2~9^2~31^2~113 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=385224b3bbe715c82b3db0db366bf7a59fdce9b0;p=pixelpark%2Fcreate-vmware-tpl.git Start integrating lib/cr_vmware_tpl/cobbler.py into lib/cr_vmware_tpl/handler.py --- diff --git a/lib/cr_vmware_tpl/cobbler.py b/lib/cr_vmware_tpl/cobbler.py index b7fe275..307b008 100644 --- a/lib/cr_vmware_tpl/cobbler.py +++ b/lib/cr_vmware_tpl/cobbler.py @@ -27,7 +27,7 @@ from .config import CrTplConfiguration from .xlate import XLATOR -__version__ = '0.0.1' +__version__ = '0.1.1' LOG = logging.getLogger(__name__) diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index d02f337..375554a 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -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)