From: Frank Brehm Date: Tue, 7 Sep 2021 14:57:26 +0000 (+0200) Subject: Defining new step 'vmw-test' X-Git-Tag: 1.5.2^2~7 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=e807ff640687186fc5308170afbd64d2002dc116;p=pixelpark%2Fcreate-terraform.git Defining new step 'vmw-test' --- diff --git a/lib/cr_tf/config.py b/lib/cr_tf/config.py index 65ab9a9..18adb72 100644 --- a/lib/cr_tf/config.py +++ b/lib/cr_tf/config.py @@ -32,7 +32,7 @@ from .errors import CrTfConfigError from .xlate import XLATOR -__version__ = '1.5.0' +__version__ = '1.5.1' LOG = logging.getLogger(__name__) _ = XLATOR.gettext diff --git a/lib/cr_tf/handler.py b/lib/cr_tf/handler.py index 21f3a65..387ae77 100644 --- a/lib/cr_tf/handler.py +++ b/lib/cr_tf/handler.py @@ -67,7 +67,7 @@ from .terraform.disk import TerraformDisk from .xlate import XLATOR -__version__ = '3.5.6' +__version__ = '3.6.0' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -161,16 +161,17 @@ class CreateTerraformHandler(BaseHandler): tz = pytz.timezone(tz_name) steps = ( - 'init', 'read-yaml', 'pdns-zones', 'vmw-init', 'collect-folders', 'vmw-clusters', - 'vmw-datastores', 'vmw-ds-clusters', 'vmw-networks', 'vmw-templates', + 'init', 'vmw-init', 'read-yaml', 'pdns-zones', 'vmw-test', 'collect-folders', + 'vmw-clusters', 'vmw-datastores', 'vmw-ds-clusters', 'vmw-networks', 'vmw-templates', 'validate-yaml', 'validate-storage', 'validate-iface', 'validate-dns', 'perform-dns', 'project-dir', 'tf-files', 'ensure-vmw-folders', ) step_desc = { 'init': _('After initialization of all objects and handlers.'), + 'vmw-init': _('After initialisation of VSPhere handlers.'), 'read-yaml': _('After reading the given YAML file.'), 'pdns-zones': _('After retrieving all DNS zones from PowerDNS.'), - 'vmw-init': _('After initialisation of VSPhere handlers.'), + 'vmw-test': _('After testing VSPhere handlers.'), 'collect-folders': _('After collecting all VMWare and local folders.'), 'vmw-clusters': _('After collecting all VMWare clusters.'), 'vmw-datastores': _('After collecting all VMWare datastores.'), @@ -799,6 +800,9 @@ class CreateTerraformHandler(BaseHandler): # -------------------------------------------------------------------------· def test_vsphere_handlers(self): + if self.stop_at_step == 'vmw-test': + self.incr_verbosity() + for vname in self.vsphere.keys(): try: @@ -814,6 +818,10 @@ class CreateTerraformHandler(BaseHandler): except VSphereExpectedError as e: raise ExpectedHandlerError(str(e)) + LOG.info(_("Finished step {!r}.").format('vmw-test')) + if self.stop_at_step == 'vmw-test': + raise AbortExecution('vmw-test') + # -------------------------------------------------------------------------· def assign_default_vmw_values(self): """Assigning not defined templates and clusters of VMs by their