From 49b185109f7cc0247b88dadd4c11074af446509a Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 24 Oct 2018 15:06:22 +0200 Subject: [PATCH] Checking network for availebility --- lib/cr_vmware_tpl/handler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() -- 2.39.5