]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Fixing lib/cr_tf/handler.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 6 Nov 2019 14:15:27 +0000 (15:15 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 6 Nov 2019 14:15:27 +0000 (15:15 +0100)
lib/cr_tf/handler.py

index e0d540df2c4da34d43a90396a75899fb472e808c..ea970dd89dafc3515e53c3a319bf404b88ee5307 100644 (file)
@@ -61,7 +61,7 @@ from .terraform.disk import TerraformDisk
 
 from .xlate import XLATOR
 
-__version__ = '3.1.5'
+__version__ = '3.1.6'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -2269,7 +2269,7 @@ class CreateTerraformHandler(BaseHandler):
 
         ''')
 
-        for cluster in self.vsphere[vs_name].clusters:
+        for cluster in vsphere.clusters:
             tpl = textwrap.dedent('''\
             data "vsphere_resource_pool" "{pv}" {{
               name          = "{pn}"
@@ -2282,7 +2282,7 @@ class CreateTerraformHandler(BaseHandler):
 
         if self.used_dc_clusters:
             for dsc_name in sorted(self.used_dc_clusters[vs_name], key=str.lower):
-                dsc_tf_name = self.vsphere[vs_name].ds_cluster_mapping[dsc_name]
+                dsc_tf_name = vsphere.ds_cluster_mapping[dsc_name]
                 tpl = textwrap.dedent('''\
                 data "vsphere_datastore_cluster" "{tn}" {{
                   name          = "{n}"
@@ -2294,7 +2294,7 @@ class CreateTerraformHandler(BaseHandler):
 
         if self.used_datastores:
             for ds_name in sorted(self.used_datastores[vs_name], key=str.lower):
-                ds_tf_name = self.vsphere[vs_name].ds_mapping[ds_name]
+                ds_tf_name = vsphere.ds_mapping[ds_name]
                 tpl = textwrap.dedent('''\
                 data "vsphere_datastore" "{tn}" {{
                   name          = "{n}"
@@ -2305,7 +2305,7 @@ class CreateTerraformHandler(BaseHandler):
                 content += tpl.format(tn=ds_tf_name, n=ds_name)
 
         for net_name in sorted(self.used_networks[vs_name], key=str.lower):
-            net_tf_name = self.vsphere[vs_name].network_mapping[net_name]
+            net_tf_name = vsphere.network_mapping[net_name]
             tpl = textwrap.dedent('''\
             data "vsphere_network" "{tn}" {{
               name          = "{n}"
@@ -2317,7 +2317,7 @@ class CreateTerraformHandler(BaseHandler):
 
         if self.vsphere_templates:
             for tname in sorted(self.vsphere_templates[vs_name].keys(), key=str.lower):
-                tpl_tf_name = self.vsphere_templates[vs_name][tname]['tf_name']
+                tpl_tf_name = self.vsphere_templates[vs_name][tname].tf_name
                 tpl = textwrap.dedent('''\
                 data "vsphere_virtual_machine" "{tn}" {{
                   name          = "{n}"