From: Frank Brehm Date: Wed, 24 Oct 2018 13:06:22 +0000 (+0200) Subject: Checking network for availebility X-Git-Tag: 0.3.2^2~28 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=49b185109f7cc0247b88dadd4c11074af446509a;p=pixelpark%2Fcreate-vmware-tpl.git Checking network for availebility --- diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index 0ed037d..970bba6 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -42,7 +42,7 @@ from fb_tools.vsphere.server import VsphereServer from .config import CrTplConfiguration -__version__ = '0.10.5' +__version__ = '0.10.6' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -156,6 +156,11 @@ class CrTplHandler(BaseHandler): LOG.error("Could not find VSphere cluster {!r}.".format(self.config.vsphere_cluster)) return 6 + if self.config.network not in self.cluster.networks: + LOG.error("Network {n!r} not available in cluster {c!r}.".format( + n=self.config.network, c=self.cluster.name)) + return 6 + self.vsphere.ensure_vm_folder(self.config.folder) self.check_for_temp_tpl_vm(no_error=True) self.select_data_store()