]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Checking network for availebility
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 Oct 2018 13:06:22 +0000 (15:06 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 Oct 2018 13:06:22 +0000 (15:06 +0200)
lib/cr_vmware_tpl/handler.py

index 0ed037d157497dfbe525b212a4bc22e6d36ca1cd..970bba6020eebf94a5663d940babc1e1c5a0b327 100644 (file)
@@ -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()