From 9d1625ced5796cd2664e9e9df4ad21af13f30af9 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 1 Oct 2019 14:08:30 +0200 Subject: [PATCH] Changing some methods for multi VSPhere support --- bin/xtract-xlate-msgs.sh | 2 +- lib/cr_tf/handler.py | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/bin/xtract-xlate-msgs.sh b/bin/xtract-xlate-msgs.sh index 712ffe1..2541086 100755 --- a/bin/xtract-xlate-msgs.sh +++ b/bin/xtract-xlate-msgs.sh @@ -53,7 +53,7 @@ for lang in de_DE en_US ; do --output-dir "${locale_dir}" \ --locale "${lang}" \ --width ${po_with} \ - --update-header-comment + --update-header-comment --previous fi # --ignore-obsolete \ done diff --git a/lib/cr_tf/handler.py b/lib/cr_tf/handler.py index 7b31fb4..4fe5fbe 100644 --- a/lib/cr_tf/handler.py +++ b/lib/cr_tf/handler.py @@ -59,7 +59,7 @@ from .terraform.disk import TerraformDisk from .xlate import XLATOR -__version__ = '2.9.3' +__version__ = '2.9.4' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -704,7 +704,8 @@ class CreateTerraformHandler(BaseHandler): if self.stop_at_step == 'vmw-datastores': self.incr_verbosity() - self.vsphere.get_datastores() + for vname in self.vsphere: + self.vsphere[vname].get_datastores() LOG.info(_("Finished step {!r}.").format('vmw-datastores')) if self.stop_at_step == 'vmw-datastores': @@ -716,7 +717,8 @@ class CreateTerraformHandler(BaseHandler): if self.stop_at_step == 'vmw-ds-clusters': self.incr_verbosity() - self.vsphere.get_ds_clusters() + for vname in self.vsphere: + self.vsphere[vname].get_ds_clusters() LOG.info(_("Finished step {!r}.").format('vmw-ds-clusters')) if self.stop_at_step == 'vmw-ds-clusters': @@ -728,13 +730,14 @@ class CreateTerraformHandler(BaseHandler): if self.stop_at_step == 'vmw-networks': self.incr_verbosity() - self.vsphere.get_networks() - if self.eval_errors: - msg = ngettext( - "Found one error in exploring vSphere resources.", - "Found {n} errors in exploring vSphere resources.", - self.eval_errors).format(n=self.eval_errors) - raise ExpectedHandlerError(msg) + for vname in self.vsphere: + self.vsphere[vname].get_networks() + if self.eval_errors: + msg = ngettext( + "Found one error in exploring vSphere {v!r} resources.", + "Found {n} errors in exploring vSphere {v!r} resources.", + self.eval_errors).format(n=self.eval_errors, v=vname) + raise ExpectedHandlerError(msg) LOG.info(_("Finished step {!r}.").format('vmw-networks')) if self.stop_at_step == 'vmw-networks': -- 2.39.5